I don't get any error message if type a faulty computer name with the code below this text.
Can someone help me, how I can get it done?
Can someone help me, how I can get it done?
C#:
try
{
buttonStatus.Enabled = false;
statusComputer = textBoxComputer.Text;
ProcessStartInfo status = new ProcessStartInfo("cmd");
status.Arguments = "/c systeminfo /s " + statusComputer + " | findstr /B " + winVersion + " " + osName + " " + systemInfo + " " + installDate;
//mesessageBox.Show(checkComputer);
status.UseShellExecute = false;
status.CreateNoWindow = true;
status.WindowStyle = ProcessWindowStyle.Hidden;
status.RedirectStandardOutput = true;
status.RedirectStandardInput = false;
var prog = Process.Start(status);
string statustext = prog.StandardOutput.ReadToEnd();
richTextBoxStatus.Text = statustext;
MessageBox.Show("Task completed!");
}
catch
{
MessageBox.Show("Error!");
}
buttonStatus.Enabled = true;