Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您可以按Windows+锁定 Windows PC L。
如何使用 VB.NET 或 C# 锁定 Windows PC?
一个简短的例子会很有帮助。
使用 PInvoke调用LockWorkStation函数。
以下代码可用于以编程方式锁定计算机。
using System.Runtime.InteropServices; [DllImport("user32.dll")] public static extern void LockWorkStation();