I have been trying to grab the console output from the following to
private void List_Adapter()
{
using (Process tshark = new Process())
{
tshark.StartInfo.FileName = ConfigurationManager.AppSettings["fileLocation"];
tshark.StartInfo.Arguments = "-D";
tshark.StartInfo.CreateNoWindow = true;
tshark.StartInfo.UseShellExecute = false;
tshark.StartInfo.RedirectStandardOutput = true;
tshark.OutputDataReceived += new DataReceivedEventHandler(TSharkOutputHandler);
tshark.Start();
tshark.BeginOutputReadLine();
tshark.WaitForExit();
}
}
void TSharkOutputHandler(object sender, DataReceivedEventArgs e)
{
this.Dispatcher.Invoke((Action)(() =>
{
tboxConsoleOutput.AppendText(e.Data);
}));
}
But the ui just freezes, no info is being displayed am I just approaching this incorrectly
I have found the following and tried with no luck
No access different thread
Object different thread
Redirect Output to Textbox
Output to Textbox
Process output to richtextbox