设置程序以管理员模式运行

来源:互联网 发布:js 计数器 编辑:程序博客网 时间:2024/05/16 17:18

 http://blog.csdn.net/vince6799/article/details/7646902

选中"Security",在界面中勾选"Enable ClickOnce Security Settings"后,在Properties下就有自动生成app.manifest文件。

打开app.manifest文件,找到如下代码:

[html] view plaincopyprint?
  1. <requestedExecutionLevellevel="asInvoker"uiAccess="false"/> 

将其修改为:

[html] view plaincopyprint?
  1. <requestedExecutionLevellevel="requireAdministrator"uiAccess="false"/> 

然后在"Security"中再勾去"Enable ClickOnce Security Settings"后,重新编译就可以了。

 

原创粉丝点击