Update the client to redirect Tor output.
This commit is contained in:
@@ -323,11 +323,13 @@ namespace Tor
|
||||
psi.CreateNoWindow = true;
|
||||
psi.UseShellExecute = false;
|
||||
psi.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
psi.RedirectStandardOutput = true;
|
||||
psi.WorkingDirectory = Path.GetDirectoryName(createParams.Path);
|
||||
|
||||
try
|
||||
{
|
||||
process = new Process();
|
||||
process.OutputDataReceived += OutputDataReceived;
|
||||
process.EnableRaisingEvents = true;
|
||||
process.Exited += new EventHandler(OnHandleProcessExited);
|
||||
process.StartInfo = psi;
|
||||
@@ -339,6 +341,7 @@ namespace Tor
|
||||
|
||||
throw new TorException("The tor application process failed to launch");
|
||||
}
|
||||
process.BeginOutputReadLine();
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
@@ -367,6 +370,11 @@ namespace Tor
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void OutputDataReceived(object sender, DataReceivedEventArgs e)
|
||||
{
|
||||
Console.WriteLine(e.Data);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Shuts down the tor application process and releases the associated components of the class.
|
||||
|
||||
Binary file not shown.
Reference in New Issue
Block a user