yaodong

yaodong
随笔 - 20, 评论 - 367, 引用 - 53

导航

标签

每月存档

最新留言

广告

 

创建进程的时候,把ProcessStartInfo 的RedirectStandardOutput 设为true

UseShellExecute 设为false

如果让创建的进程不可见,把CreateNoWindow 设为true

   ProcessStartInfo psi = new ProcessStartInfo();
   psi.FileName = “<<exe file name>>“;
   psi.UseShellExecute = false;
   psi.CreateNoWindow = true;
   psi.RedirectStandardOutput = true;

   Process p = Process.Start(psi);
   while(p.WaitForExit(0) == false)
   {
    String s = p.StandardOutput.ReadLine();
   }

这样你就可以获得你所创建的进程调用Console.Write的输出

打印 | 张贴于 2004-08-12 13:25:00 | Tag:暂无标签

留言反馈

#回复: .NET获取其它程序的标准输出(stdout) 编辑
强烈鄙视“谷歌”............................................
2008-01-04 09:12:00 | [匿名:试卷]
#re:.NET获取其它程序的标准输出(stdout) 编辑
^_^,Pretty Good!
2005-04-16 08:24:00 | [匿名:风速仪]
#re:.NET获取其它程序的标准输出(stdout) 编辑
^_^,Pretty Good!
2005-04-10 20:25:00 | [匿名:滴胶机]
#re: .NET获取其它程序的标准输出(stdout) 编辑
77
2004-10-22 15:39:00 | [匿名:777]
对不起,目前本随笔不允许发表新评论.

Powered by: Joycode.MVC引擎 0.5.2.0