我正在尝试从Unity运行命令提示符,我的问题是我找不到获取结果的方法,这是我的代码
Process myProcess = new Process();
myProcess.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
myProcess.StartInfo.CreateNoWindow = true;
myProcess.StartInfo.UseShellExecute = false;
myProcess.StartInfo.RedirectStandardOutput = true;
myProcess.StartInfo.FileName = "C:\\Windows\\system32\\cmd.exe";
string path = "C:\\Users\\Sam\\Desktop\\Test\\rubik3Sticker.generator";
myProcess.StartInfo.Arguments = "call " + path;
myProcess.EnableRaisingEvents = true;
myProcess.Start();
直到这里它没有例外,但当我尝试添加它时团结崩溃:
while(!myProcess.StandardOutput.EndOfStream)
print(myProcess.StandardOutput.ReadLine());
任何形式的帮助都将不胜感激,谢谢!