Refer to related article: http://blog.csdn.net/jayzai/article/details/7563248
Ps:c# How to run a program as an administrator
"When using the WinForm program to get a call to the cmd command prompt, if it is more than Win7 operating system, it will need to be run as administrator to perform successfully, otherwise no effect or prompt error. 】
In visual Studio--Solution Explorer--right-click on the project name-Properties, find the "security" option, tick "Enable ClickOnce Security Settings", at this point, there will be an extra "app.manifest" file under the project, select it, and find the code snippet <requestedexecutionlevel level= "AsInvoker" uiaccess= "false"/> change it to: <requestedexecutionlevel level= " Requireadministrator "uiaccess=" false "/>", and then open the "Properties-security" interface again, remove the check before "Enable ClickOnce security Settings" before compiling and running.
C # Note17: Extracting files using Ionic.Zip.dll