Vista Windows 7 uses UAC to control program access. For programs that need to run as administrators, right-click and run as administrators.
C # in programming, the program can run automatically as an administrator, that is, we often see a shield on some program icons.
Find app. manifest in the properties directory of the source code,
Change level = "asinvoker" to level = "requireadministrator,
If no app. manifest file exists, you can open the project properties, locate the security item, and enable clickonce security settings. The app. manifest file is generated,
Then remove the check box.
In this way, you re-compile the program, and a small shield will appear on your program icon. Then, you will automatically run your program as an administrator without right-clicking it.
If you cannot see the little shield, the notification may be set to "never notice" in "User Account Control Settings ". You can see it by default.