如何强制我的.NET应用程序作为管理员在Windows 7上运行吗? [英] How to force my .NET App to run as administrator on Windows 7?

查看:358
本文介绍了如何强制我的.NET应用程序作为管理员在Windows 7上运行吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的程序被安装在客户机上,我怎么逼我的程序作为管理员在Windows 7上运行吗?

Once my program is installed on a client machine, how do I force my program to run as an administrator on Windows 7?

推荐答案

您会希望修改被嵌入程序清单。这适用于VS2008及以上:项目+添加新项,选择应用程序清单文件。更改< requestedExecutionLevel> 元素:

You'll want to modify the manifest that gets embedded in the program. This works on VS2008 and higher: Project + Add New Item, select "Application Manifest File". Change the <requestedExecutionLevel> element to:

 <requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

用户收到UAC提示时,启动该程序。用在刀刃上,他们的耐心能迅速磨损。

The user gets the UAC prompt when they start the program. Use wisely, their patience can wear out quickly.

这篇关于如何强制我的.NET应用程序作为管理员在Windows 7上运行吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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