public static void ResetVirCom(string VirPath)
{
System.Diagnostics.Process[] process = System.Diagnostics.Process.GetProcessesByName("VSPort");
foreach(System.Diagnostics.Process p in process)
{
if(p.ProcessName == "VSPort")
{
VirPath =  p.MainModule.FileName;
p.Kill();
(new DeviceSetup()).ClearNotfy();
}
}
System.Diagnostics.ProcessStartInfo start = new System.Diagnostics.ProcessStartInfo();
start.FileName = VirPath;
start.WindowStyle = System.Diagnostics.ProcessWindowStyle.Minimized;
            
System.Diagnostics.Process pVir = System.Diagnostics.Process.Start(start);//??
                 YAMAHA.BusinessLogic.EventsLog.WriteEvent("启动VirCom","Success");
System.Threading.Thread.Sleep(2000); }这个是一个启动程序的函数,有什么办法能判断这个程序是否启动呢。
日志是写进去了。但是我估计程序没有真正启动.