Process[] ps = Process.GetProcessesByName
问题:什么时候出现ps == null ,什么时候出现ps.Length == 0
Process[] ps = Process.GetProcessesByName("soffice.bin"); //获取进程数组
if (ps == null || ps.Length == 0) //??什么时候出现为零情况
{
Process p = Process.Start(openofficePath, "-headless -nologo -norestore -invisible -nofirststartwizard"); //参数: 4:进程不可见 5:不需要开始向导
//spent some time to start 花一些时间来启动进程
System.Threading.Thread.Sleep(30000);//3000
}