成为“真正的管理员”(Windows) 并在 .NET C# 中执行真正的管理任务?
在 Windows 中,仅仅因为您的帐户位于管理员组中并不意味着它有足够的权限能够删除某些系统文件。有没有办法在 C# 中使用这种“最高”管理权限执行操作,而无需登录管理员帐户(仅使用管理员组中的帐户)。
编辑
就我而言,它是一个个人应用程序(很抱歉我没有指定这一点),我相信自己不会删除任何系统文件或让任何流氓病毒访问此权限。我在个人计算机上使用域帐户,虽然我的个人计算机上有管理员,但我不想继续在用户之间切换。我想要的是一种以尽可能高的特权用户身份运行我的程序的简单方法。除非以完整管理员身份登录,否则没有任何办法吗?
In Windows just because your account is in the Administrators group doesn't mean it is privileged enough to be able to delete some system files. Is there a way to perform actions with this 'supreme' admin power in C# without having to login to Administrator account(Only using an account in the Administrators group).
EDIT
In my case it is a personal application (I'm sorry I didn't specify this) and I trust myself to not delete any system files or give any rogue virus access to this privilege. I am using a domain account on a personal computer and while I have got Administrator on my personal computer I don't want to keep switching between users. What I want is a simple way of running my program as the highest possible privileged user. Is there no way whatsoever unless logged in as a full Administrator?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题已解答谢谢。我被告知,无法像在 Linux 中使用 sudo 命令那样以完全管理员权限启动应用程序。添加 UAC 清单很有帮助,因为它指定了如何在我的应用程序中实施权限 (http://msdn.microsoft.com/en-us/library/bb756929.aspx)。
//关闭
Question Answered thanks. I have been informed that there is no possible way of launching an application with FULL administrator rights as you can in Linux with the sudo command. Adding a UAC manifest was helpful though as it specified how to implement rights into my app(http://msdn.microsoft.com/en-us/library/bb756929.aspx).
//closed