How to Lock Windows (like "Windows + L") from .NET? How to Lock Windows (like "Windows + L") from .NET? windows windows

How to Lock Windows (like "Windows + L") from .NET?


The following code can be used to Lock a Computer programmatically.

using System.Runtime.InteropServices;[DllImport("user32.dll")]public static extern void LockWorkStation();