Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

You can lock a Windows PC by pressing Windows + L.

How can I lock a Windows PC using VB.NET or C#?

A short example would be helpful.

like image 280
Augis Avatar asked Aug 04 '12 22:08

Augis


1 Answers

Call the LockWorkStation function using PInvoke.

like image 180
usr Avatar answered Oct 31 '22 19:10

usr