[DllImport("user32.dll")]
public static extern void LockWorkStation()

// Lock workstation
LockWorkStation();