您可以通過按Windows + L來鎖定Windows PC。如何從.NET鎖定Windows(如「Windows + L」)?
如何鎖定使用VB.NET或C#的Windows PC?
一個簡短的例子會有幫助。
您可以通過按Windows + L來鎖定Windows PC。如何從.NET鎖定Windows(如「Windows + L」)?
如何鎖定使用VB.NET或C#的Windows PC?
一個簡短的例子會有幫助。
以下代碼可用於以編程方式鎖定計算機。
using System.Runtime.InteropServices;
[DllImport("user32.dll")]
public static extern void LockWorkStation();
'rundll32'不是爲了調用任意導出的函數而設計的。 – Neil 2012-08-04 23:28:48
[相關問題](http://stackoverflow.com/questions/4259571/how-to-lock-the-screen-in-windows)在C/C++ – Deanna 2012-08-06 10:36:27