Hi. I have the following code:
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");
}
I'm trying to redirect the output to my program. tshark is sniffer, so it works until was suspended. How to redirect data in real time? Thanks.