急!急!急!急!帮我看看代码!! 在线等~~~~
程序运行到这个函数 就失去响应 得不到返回值
在 任务管理器 中可以看一个cmd.exe 一直不能结束
我手动 把 cmd.exe结了回
程序就得到了响应
这 是怎么回事
帮看看~~~~
public string ToObjFile(string path,string fileName)
{
Process p = new Process ();
p.StartInfo .FileName ="cmd.exe";
p.StartInfo .RedirectStandardError =true;
p.StartInfo .RedirectStandardInput =true;
p.StartInfo .RedirectStandardOutput =true;
p.StartInfo .CreateNoWindow =true;
p.StartInfo .UseShellExecute =false;
p.StartInfo. WorkingDirectory =path.Substring(0,path.LastIndexOf("\\"));
p.Start ();
p.StandardInput .WriteLine(SetPath);
p.StandardInput .WriteLine ("masm.exe" + " " + fileName +",,,; " );
p.StandardInput.WriteLine("exit");
string msg=p.StandardOutput.ReadToEnd();
p.Close();
return msg;
}