Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }));
- }
Advertisement
Add Comment
Please, Sign In to add comment