System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.UseShellExecute = false;
p.StartInfo.FileName = "cmd";
p.StartInfo.Arguments = "/C ipconfig /all";
p.Start();
StreamReader sr = p.StandardOutput;
while ((sr.ReadLine()) != null)
{
Console.WriteLine(sr.ReadLine());
}
No comments:
Post a Comment