2
我有以下代码:重定向非标准流(的Process.Start)
private void button1_Click(object sender, EventArgs e)
{
Process process = new Process();
ProcessStartInfo processStartInfo = new ProcessStartInfo();
processStartInfo.Arguments = "-i 1 -x";
processStartInfo.CreateNoWindow = false;
processStartInfo.FileName = @"F:\NET\WiresharkPortable\App\Wireshark\tshark.exe";
processStartInfo.RedirectStandardOutput = true;
processStartInfo.UseShellExecute = false;
process.StartInfo = processStartInfo;
process.Start();
StreamReader streamReader = process.StandardOutput;
textBox1.AppendText(streamReader.ReadToEnd() + "\r\n");
}
我试图输出重定向到我的程序。 tshark是嗅探器,所以它可以工作直到被暂停。如何实时重定向数据?谢谢。
非常感谢。 – user348173 2010-10-12 10:49:58