process_cmd.StartInfo.UseShellExecute = false;是什么意思啊
1个回答
展开全部
UseShellExecute must be true if you set the ErrorDialog property to true.
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 launched and only has meaning within the context of the new process.
上面是MSDN原话,其实UseShellExecute 可以调用关联程序打开非可执行文件,如mp3;
如果为false时,就是直接启动进程,只能执行可执行文件,必须指定完整路径,如exe和com文件,并且可以重定向标准输入与输出。
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 launched and only has meaning within the context of the new process.
上面是MSDN原话,其实UseShellExecute 可以调用关联程序打开非可执行文件,如mp3;
如果为false时,就是直接启动进程,只能执行可执行文件,必须指定完整路径,如exe和com文件,并且可以重定向标准输入与输出。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询