mrcsharp
ارسالها: | 12 |
عضویت: | 18 /8 /1393 |
تشکر ها: | 1 |
تشکر شده: | 3 |
|
سوال : اجرای دستورات cmd در برنامه
نقل قول از mrcsharp
کد:
string pass=Environment.UserName;
System.Diagnostics.ProcessStartInfo hyp = new System.Diagnostics.ProcessStartInfo("cmd");
hyp.RedirectStandardInput = true;
hyp.RedirectStandardOutput = true;
hyp.UseShellExecute = false;
System.Diagnostics.Process proc = System.Diagnostics.Process.Start(hyp);
proc.StandardInput.WriteLine(@"net user '"+pass+"' password");
proc.StandardInput.WriteLine(@"");
string output = proc.StandardOutput.ReadToEnd();
از کد بالا استفاده شده
|
|
یکشنبه 18 آبان 1393 - 22:39 |
|