process打开应用程序的时候,最好要指定工作目录,否则会出现一些错误
private static void StartRobot(string path, string exe) { Process myProcess = new Process(); try { myProcess.StartInfo.UseShellExecute = false; myProcess.StartInfo.FileName = Path.Combine(path, exe); myProcess.StartInfo.WorkingDirectory = path; myProcess.StartInfo.CreateNoWindow = true; myProcess.StartInfo.Verb = "RunAs"; myProcess.Start(); } catch (Exception e) { Console.WriteLine(e.Message); } }