如何在C#中锁定Windows中的屏幕? [英] How to go to lock screen in Windows in C#?

查看:243
本文介绍了如何在C#中锁定Windows中的屏幕?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

转到锁定屏幕,询问Windows用户帐户密码

to go to lock screen where it's asked for Windows user account password

推荐答案

有两种选择



1.挂钩API并致电 LockWorkStation [ ^ ]函数

2.从您的代码执行此shell命令:
There are two options

1. Hook to the API and call LockWorkStation[^] function
2. Execute this shell command from your code:
rundll32.exe user32.dll, LockWorkStation


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

Usage: 

  LockWorkStation();


这篇关于如何在C#中锁定Windows中的屏幕?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆