How to set runtime for .Net application

How to set the execution level for a .Net application to run with administrator privileges when it is launched in a regular user account in Win XP?

+3
source share
1 answer

access to the registry requires an elevated privilege. However, there is only a piece of code that requires additional permission. Impersonation is used to process such scenarios, that is, you will run this application as a regular user, but this particular piece of code will be executed as if you were an administrator.

http://msdn.microsoft.com/en-us/library/system.security.principal.windowsimpersonationcontext.aspx

0
source

Source: https://habr.com/ru/post/1748801/