哪些部分.NET的需要管理员权限才能执行? [英] What parts of .NET require administrative privileges to be executed?

查看:134
本文介绍了哪些部分.NET的需要管理员权限才能执行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

哪个框架部分需要用户超过标准用户?我问的原因是因为我想迁移到Windows 7时,编译可能的问题清单与我们现有的应用程序。

Which parts of the framework require a user to be more than a Standard User? The reason I'm asking is because I'm trying to compile a list of possible issues with our existing applications when migrating to Windows 7.

现在,我能想到的一些事情自己:

Now, I can think of a few things myself:

  • 写入事件日志
  • 写入注册表项CURRENT_USER范围
  • 在获取环境变量
  • 等等...

我真的想一个更完整的列表,到目前为止,我还没有遇到过的,所有这些东西列一个体面的资源。

I really would like a more complete list and so far I've not come across a decent resource in which all this stuff is listed.

请注意,我不是在寻找提升的权限为现有的应用程序(可以通过使用一个清单来完成),我只是识别code动作可能会导致问题的方式。

Note that I'm not looking for ways of elevating the privileges for the existing apps (which can be done by using a manifest), I'm simply identifying actions in code that might cause issues.

推荐答案

好了,你的例子真的没有任何与Windows 7或.NET。其实他们已经的设计用于Windows NT 4.0标识要求的一部分。如果你写你的应用程序的方式,非管理员用户能够在NT,Win2K或XP中运行它,它只是正常工作在Vista / Win7的。

Well, your examples don't really have anything to do with Windows 7 or .NET. Actually they were already part of the "Designed for Windows NT 4.0" logo requirements. If you have written your application in a way that non-admin users were able to run it on NT, Win2k or XP, it will just work fine on Vista/Win7.

当您在x64系统上运行的软件(然而,这也太不针对Win7的却是真实的,例如用于Win2003的服务器64或Win XP x64的为好)还有一个常见的​​错误:如果您使用的是原生32位位code,来电来样原生DLL或COM互操作使用过程中的组成部分),请务必选择86作为目标平台在Visual Studio项目设置,而不是任何CPU。否则,你的应用程序将作为一个64位进程中运行,而不能混用32位和64位code在同一个进程,所以你会碰到的错误。

There is another common pitfall when you run your software on x64 systems (however this too isn't specific to Win7 but is true e. g. for Win2003 Server x64 or Win XP x64 as well): If you are working with native 32-bit code, like calls to a native DLL or COM interop with a in-process component), make sure to select "x86" as the platform target in Visual Studio project settings instead of "Any CPU". Otherwise your application will run as a 64 bit process, and you can't mix 32 and 64 bit code in the same process, so you would run into errors.

和,因为它一直是最好的做法,使用 Environment.GetSpecialFolders ,而不是硬codeD的路径。

And of course, as it always has been best practice, use Environment.GetSpecialFolders instead of hard-coded paths.

这篇关于哪些部分.NET的需要管理员权限才能执行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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