c# progress.start 程序,程序自动退出的原因
需要设置程序的工作目录。progress.woringdirectory="c:\$#%$%$%";
Property Value
Type: System.StringThe fully qualified name of the directory that contains the process to be started. The default is an empty string ("").
Important |
---|
The WorkingDirectory property must be set if UserName and Password are provided. If the property is not set, the default working directory is %SYSTEMROOT%\system32. |
If the directory is already part of the system path variable, you do not have to repeat the directory's location in this property.
The WorkingDirectory property behaves differently when UseShellExecute is true than when UseShellExecute is false. When UseShellExecute is true, the WorkingDirectory property specifies the location of the executable. If WorkingDirectory is an empty string, the current directory is understood to contain the executable.
When UseShellExecute is false, the WorkingDirectory property is not used to find the executable. Instead, it is used by the process that is started and only has meaning within the context of the new process.