ok so the first thing you need to do in order to use a windows api function(this is for the DLL "User32.dll") is to add a reference to the System.Runtime.InteropServices
by doing this:
using System.Runtime.InteropServices;
then you import the DLL like this(note you do this in the space right before the constructor for a winform app):
[DllImport("user32.dll")]
here is an example of how to import the LockWorkStation method from the newly imported "User32.dll" (Note: you should add the proceeding line of code right under the DLL import statement):
public static extern void LockWorkStation();
now this method doesn't take any arguments so you call it like this:
LockWorkStation();
this will lock your computer so i would put this in a button event method or something
this is a very simple use of the windows api and a very easy to do operation.
C# can access the windows api its just a little harder than C++.
i hope this gets you started and helps,
MasterCodeon