process问题
在用process调用其实程序时,没有结果 ,该程序在cmd中运行显示结果正常
在process调用时就有问题,FileName直接用c:\C++.exe也没有效果
望达人相告,问题在哪里
Process process = new Process();
process.StartInfo.WindowStyle = ProcessWindowStyle.Maximized;
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.FileName = "cmd.exe ";
process.Start();
//process.StandardInput.AutoFlush = true;
//process.
process.StandardInput.WriteLine( "C:\\c++.exe ");
//process.StandardInput.WriteLine(text + "\r\nexit ");
label1.Text = process.StandardOutput.ReadToEnd();
process.Close();
process.Dispose();
------解决方案--------------------不明白lz的意思,帮顶
------解决方案--------------------你直接调C:\\c++.exe不行吗?干嘛用cmd.exe?
------解决方案--------------------System.Diagnostics.Process.Start( "CMD.exe ", "/c c:\\C++.exe ");
------解决方案--------------------http://dotnet.aspx.cc/article/ebe38f5b-bd7e-42c2-73e4-49616f98be3d/read.aspx
------解决方案--------------------不懂,帮顶
------解决方案--------------------友情UP
------解决方案--------------------process.StartInfo.UseShellExecute = true;
------解决方案--------------------