简体   繁体   English

Delphi作为不同的用户运行

[英]Delphi run as different user

I want a way in Delphi which I can run an exe file as a different user in order to gain different permissions. 我想在Delphi中使用一种方法,我可以将exe文件作为不同的用户运行,以获得不同的权限。 I do not want elevation of permissions. 我不想提升权限。 Screenshot: 截图:

在此输入图像描述

I want from delphi code to start an application as a different user as depicted in the picture. 我希望从delphi代码中以不同的用户启动应用程序,如图所示。

The API function that you are looking for is CredUIPromptForCredentials . 您正在寻找的API函数是CredUIPromptForCredentials This returns a username and password that you can pass to CreateProcessWithLogonW . 这将返回您可以传递给CreateProcessWithLogonW的用户名和密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM