Guest User

Untitled

a guest
Feb 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. private void richTextBox1_TextChanged(object sender, EventArgs e)
  2. {
  3. Process process = new Process();
  4. process.StartInfo.FileName = "cmd.exe";
  5. process.StartInfo.CreateNoWindow = true;
  6. process.StartInfo.RedirectStandardInput = true;
  7. process.StartInfo.RedirectStandardOutput = true;
  8. process.StartInfo.UseShellExecute = false;
  9. process.Start();
  10. process.StandardInput.WriteLine("ipconfig");
  11. process.StandardInput.Flush();
  12. process.StandardInput.Close();
  13. process.WaitForExit();
  14.  
  15. string s = process.StandardOutput.ReadToEnd();
  16.  
  17. richTextBox1.Text = s;
  18. }
Add Comment
Please, Sign In to add comment