用于登录 Windows 用户的 API
我想以交互模式以编程方式登录另一个 Windows 用户。 我已经创建了新的 Windows 用户帐户,并且希望在没有用户交互的情况下将系统切换到该帐户。
您能给我指出一些 API 命令或 MSDN 页面吗? 谢谢
I would like to programmatically login another windows user in interactive mode.
I've created new Windows user account and would like to switch system to that account without of user interaction.
Could you please point me to some API commands or MSDN pages?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来 WTSConnectSession 是正确的方向
looks like WTSConnectSession is the right direction
如果您不是在谈论终端服务器会话,则如果您以该用户身份登录,则需要 LogonUser();如果您想以已登录用户的身份执行某些操作,则需要 ImpersonateLoggedOnUser()。 两者都可以在 Advapi32.lib 中找到。
If you're not talking about a Terminal Server session, you'll want LogonUser() if you're logging in as that user, or ImpersonateLoggedOnUser() if you're wanting to do something as an already-logged in user. Both can be found in Advapi32.lib.