请问Delphi如何写一个:Netstat -an输出到文本中显示?
俺是菜鸟,请谅解!

解决方案 »

  1.   

    最简的方法,用dos 的重定向:
       winexec('cmd.exe /c Netstat -an > tmp.txt',sw_hide);
       while not FileExists('tmp.txt') do  ;
         memo1.Lines.LoadFromFile('tmp.txt');
    当然,也可用crateprocess的重定向功能,不过较繁
      

  2.   

    dos重定向也许可以, 不过, 我想这不是你想要的...你想要的可能在这儿:: 使用管道做重定向...
    http://topic.csdn.net/u/20080603/08/cd8b25f1-6f8f-4442-859e-d794dbb2ee32.html