C # launches an external program (1)-winexec calls the Win32 API.
1.using system.runtime.interopservices;2.
//
#define SW_HIDE 0//Hide window, active state to make a window
#define SW_SHOWNORMAL 1//Display a window with its original size and position, and make it active
#define SW_NORMAL 1
#define Sw_showminimized 2
#define Sw_showmaximized 3
#define SW_MAXIMIZE 3
#define SW_SHOWNOACTIVATE 4//Display a window with the nearest size and position without changing the active window
#define SW_SHOW 5//displays a window with the current size and position, and makes it active
#define SW_MINIMIZE 6//Minimized window, active state to make a window
#define SW_SHOWMINNOACTIVE 7//Minimize a window without changing the active window
#define SW_SHOWNA 8//displays a window with the current size and position without changing the active window
#define Sw_restore 9//Same as Sw_shownormal 1
#define Sw_showdefault 10
#define Sw_forceminimize 11
#define SW_MAX 11
[DllImport ("kernel32.dll")]
public static extern int WinExec (string exename, int opertype); 3.
WinExec (@ "C:\WINDOWS\system32\cmd.exe", 5);
C # launches an external program (1)-winexec