1. Do not wait for the sub-process to complete view plaincopy to clipboardPRint?
··· · 50 ······· · 90 ····· · 140 · 150
Private void simpleRun_Click (object sender, System. EventArgs e)
{System. Diagnostics. Process. Start (@ "C: listfiles. bat ");
}
Private void simpleRun_Click (object sender, System. EventArgs e)
{System. Diagnostics. Process. Start (@ "C: listfiles. bat ");
}
2. Start the sub-process and wait for the sub-process to end and obtain the output view plaincopy to clipboardprint?
Private void runSyncAndGetResults_Click (object sender, System. EventArgs e)
{
System. Diagnostics. ProcessStartInfo psi = new System. Diagnostics. ProcessStartInfo (@ "C: listfiles. bat ");
Psi. RedirectStandardOutput = true;
Psi. WindowStyle = System. Diagnostics. ProcessWindowStyle. Hidden;
Psi. UseShellExecute = false;
System. Diagnostics. Process listFiles;
ListFiles = System. Diagnostics. Process. Start (psi );
System. IO. StreamReader myOutput = listFiles. StandardOutput;
ListFiles. WaitForExit (2000 );
If (listFiles. HasExited)
{
String output = myOutput. ReadToEnd ();
This. processResults. Text = output;
}
}
Private void runSyncAndGetResults_Click (object sender, System. EventArgs e)
{
System. Diagnostics. ProcessStartInfo psi = new System. Diagnostics. ProcessStartInfo (@ "C: listfiles. bat ");
Psi. RedirectStandardOutput = true;
Psi. WindowStyle = System. Diagnostics. ProcessWindowStyle. Hidden;
Psi. UseShellExecute = false;
System. Diagnostics. Process listFiles;
ListFiles = System. Diagnostics. Process. Start (psi );
System. IO. StreamReader myOutput = listFiles. StandardOutput;
ListFiles. WaitForExit (2000 );
If (listFiles. HasExited)
{
String output = myOutput. ReadToEnd ();
This. processResults. Text = output;
}
}
3. Open URLview plaincopy to clipboardprint in the default browser?
··· · 50 ······· · 90 ····· · 140 · 150
Private void launchill_click (object sender, System. EventArgs e)
{
String targetURL = @ http://www.duncanmackenzie.net;
System. Diagnostics. Process. Start (targetURL );