Vista UAC, Access Elevation and .Net

后端 未结 6 918
死守一世寂寞
死守一世寂寞 2020-12-10 18:18

I\'m trying to find out if there is any way to elevate a specific function within an application. For example, I have an app with system and user settings that are stored in

6条回答
  •  抹茶落季
    2020-12-10 18:50

    Found a nice article that covers this here:

    Most applications do not require administrator privileges at run time. If your application doesn't maintain cross-session state while it executes and doesn't do something like modifying the local security policy, it should be just fine running with a standard-user token. Sometimes certain parts of your application will require administrator privileges, and you should separate out those pieces into a separate process. I'll get into that a little later.

    Looks like the article is talking about using C++, so I found another article that covers how to call this code using P/Invoke. So should be doable from .NET.

提交回复
热议问题