问题描述
我是我电脑中的用户,然后我创建了一个与打印机相关的代码,为此我添加了清单文件并将requestedExecutionLevel更改为
I'm as user in my pc, then I created a code that inetracts with printer, to do this I added manifest file and changed the requestedExecutionLevel to
<requestedexecutionlevel level="requireAdministrator" uiaccess="false" />
当我运行它时,它需要管理员登录和密码。一旦我知道管理员密码,那么我将添加使用它,以便应用程序必须以管理员身份运行而不需要再次使用管理员密码,它应该直接工作。是否可以将管理员的登录名和密码添加到清单文件或源代码中?
我尝试过:
我添加了清单文件并将requestedExecutionLevel更改为
when I run it, it requires admin login and password. Once I know admin password then I'm going to add use it so that application must run as administrator without requiring admin password again, it should work directly. Is it possible to add admin's login and password into manifest file or source code?
What I have tried:
I added manifest file and changed the requestedExecutionLevel to
<requestedexecutionlevel level="requireAdministrator" uiaccess="false" />
当我运行它,它需要管理员登录和密码。一旦我知道管理员密码,那么我将添加使用它,以便应用程序必须以管理员身份运行而不需要再次使用管理员密码,它应该直接工作。是否可以将管理员的登录名和密码添加到清单文件或源代码中?
when I run it, it requires admin login and password. Once I know admin password then I'm going to add use it so that application must run as administrator without requiring admin password again, it should work directly. Is it possible to add admin's login and password into manifest file or source code?
推荐答案
这篇关于如何在不添加清单文件的情况下以管理员身份运行基于c#代码的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!