2

I want to lock the accessing of current operating user, as if the user

clicked on Start → pointed to shutdown → click on LOCK

How to do that in C#?

4

2 に答える 2

4

http://jessn.blogspot.com/2009/05/lock-my-computer-programatically-in-c.html This article says it best:

A much better design that isn't hard coded to your windows system paths, etc:

using System.Runtime.InteropServices;

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

Then just call LockWorkStation();

于 2013-02-08T14:47:24.747 に答える
0
 System.Diagnostics.Process.Start("shutdown.exe -l");





      it will LOG OFF your computer and now if the account has secure with some password then windows will ask for password otherwise not.
于 2013-02-08T17:48:00.950 に答える