|
@@ -151,13 +151,22 @@ namespace MOKA_Factory_Tools
|
|
|
/// <returns></returns>
|
|
|
public static bool StartProcess(string runFilePath, string args)
|
|
|
{
|
|
|
- Process process = new Process();//创建进程对象
|
|
|
- ProcessStartInfo startInfo = new ProcessStartInfo(runFilePath, args);
|
|
|
- startInfo.UseShellExecute = false;
|
|
|
- startInfo.CreateNoWindow = true;
|
|
|
- process.StartInfo = startInfo;
|
|
|
- return process.Start();
|
|
|
- //process.WaitForExit();
|
|
|
+ try
|
|
|
+ {
|
|
|
+ Process process = new Process();//创建进程对象
|
|
|
+ ProcessStartInfo startInfo = new ProcessStartInfo(runFilePath, args);
|
|
|
+ startInfo.UseShellExecute = false;
|
|
|
+ startInfo.CreateNoWindow = true;
|
|
|
+ process.StartInfo = startInfo;
|
|
|
+ return process.Start();
|
|
|
+ //process.WaitForExit();
|
|
|
+ }
|
|
|
+ catch (Exception ex)
|
|
|
+ {
|
|
|
+ Log.WriteErrorLog(string.Format("打开进程{0}失败:{1}", runFilePath, ex.Message));
|
|
|
+ }
|
|
|
+
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|