运行.NET应用程序以管理员身份 [英] Run .NET application as administrator

查看:259
本文介绍了运行.NET应用程序以管理员身份的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于Vista和放大器; Windows 7的出来我的一些.NET应用程序已经开始抛出安全性异常。

Since Vista & windows 7 came out some of my .NET application has started throwing security exceptions.

我注意到,有些应用程序(也就是我的防病毒软件,控制面板)有一个小盾,当我运行这些应用程序的管理员权限,从我自动要求窗口。

I've noticed that some applications (i.e. my antivirus, control panel) have a small shield and when I run these applications administrator privileges are automatically requested from me by windows.

我知道,作为一个用户,我可以设置应用程序以管理员身份运行,但是这还不够好,因为如果应用程序将运行没有特权它会崩溃在我的用户的机器。

I know that as a user I can set the application to run as administrator but that's not good enough because if the application will run without privileges it would crash on my users machines.

有没有办法告诉窗口(编程),我希望应用程序具有管理权限运行?

Is there a way to tell windows (programmatically) I want the application to run with administrative privileges?

推荐答案

您需要标记您的应用程序为要求管理员权限的应用程序清单。 下面是从MSDN杂志解释过程中的文章。

You need to mark your app as requiring admin privileges in the application manifest. Here's an article from MSDN Magazine that explains the process.

这篇关于运行.NET应用程序以管理员身份的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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