【问题标题】:How do I lock and force the user to re-enter one's windows password?如何锁定并强制用户重新输入 Windows 密码?
【发布时间】:2013-02-08 14:45:54
【问题描述】:

我想锁定当前操作用户的访问,就好像用户一样

点击开始→指向关机→点击LOCK

如何在 C# 中做到这一点?

【问题讨论】:

标签: c# windows windows-shell user-accounts


【解决方案1】:

http://jessn.blogspot.com/2009/05/lock-my-computer-programatically-in-c.html这篇文章说得最好:

没有硬编码到您的 Windows 系统的更好的设计 路径等:

使用 System.Runtime.InteropServices;

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

然后只需调用 LockWorkStation();

【讨论】:

    【解决方案2】:
     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.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-26
      • 1970-01-01
      • 2019-12-09
      相关资源
      最近更新 更多