battleangel444
Programmer
Hi All
so i've got this code for a button on an asp.net page. that tries to call thecmd.exe and run a command and caputre the output. i m having a heck of a time collecting the output.
right now my code is simpley:
private void Button2_Click(object sender, System.EventArgs e)
{
StreamReader myStream;
string s_output;
myStream = System.Diagnostics.Process.Start("cmd.exe", "/c dir").StandardOutput;
s_output = myStream.ReadToEnd().Trim();
TextBox3.Text = s_output;
}
sooooo when i click the button i get an error page.
which high lights the line with "System.Diagnostics.Process.Start"
and give the description " StandardOut has not been redirected.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
"
any insight would be greatly appreciated
-Thanks
BA4^3
so i've got this code for a button on an asp.net page. that tries to call thecmd.exe and run a command and caputre the output. i m having a heck of a time collecting the output.
right now my code is simpley:
private void Button2_Click(object sender, System.EventArgs e)
{
StreamReader myStream;
string s_output;
myStream = System.Diagnostics.Process.Start("cmd.exe", "/c dir").StandardOutput;
s_output = myStream.ReadToEnd().Trim();
TextBox3.Text = s_output;
}
sooooo when i click the button i get an error page.
which high lights the line with "System.Diagnostics.Process.Start"
and give the description " StandardOut has not been redirected.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
"
any insight would be greatly appreciated
-Thanks
BA4^3