请问我怎么把在命令模式输入ipconfig/all的信息通过C#读入到textbox或者其它控件,谢谢! 就是通过C#写程序能得到ipconfig,ping,arp等的信息。非常感谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 System.Diagnostics.Process p=new System.Diagnostics.Process(); p.StartInfo.UseShellExecute=false; p.StartInfo.RedirectStandardInput=true; p.StartInfo.RedirectStandardOutput=true; p.StartInfo.CreateNoWindow=true; p.StartInfo.FileName="cmd.exe"; p.Start(); p.StandardInput.Write("ipconfig /all\r\n"); p.StandardInput.Write("exit\r\n"); textBox1.Text=p.StandardOutput.ReadToEnd(); 试了一下 chenyuming2004(这辈子我算是废了) 的方法,觉得应该改进一下:System.Diagnostics.Process p=new System.Diagnostics.Process(); p.StartInfo.UseShellExecute=false; p.StartInfo.RedirectStandardInput=true; p.StartInfo.RedirectStandardOutput=true; p.StartInfo.CreateNoWindow=true; p.StartInfo.FileName="ipconfig.exe"; p.StartInfo.Arguments = "/all"; p.Start(); string Text=p.StandardOutput.ReadToEnd(); p.WaitForExit();// p.StartInfo.FileName="cmd.exe";// p.StandardInput.Write("ipconfig /all\r\n");// p.StandardInput.Write("exit\r\n"); 在类内部引用类的实例,参数怎么传递的? 问个web弹出窗口的问题 关于公司内部mail的问题?????????? 数学排列算法 求教textbox问题。 棘手的简单问题 问一个入门经典里面的代码的问题 我C#开发的程序,如何安装的别地机器上,怎么打包才能把.net框架安上? 我将窗体设成MDI,我想把主窗体的后面哪个滚动条给取消了怎么做 没有主菜单的对话框程序,怎在窗口上下文菜单中加上About项? 在datagrid中添加信息时,如何响应当光标移到另一个单元格的事件? 求职
p.StartInfo.UseShellExecute=false;
p.StartInfo.RedirectStandardInput=true;
p.StartInfo.RedirectStandardOutput=true;
p.StartInfo.CreateNoWindow=true;
p.StartInfo.FileName="cmd.exe";
p.Start();
p.StandardInput.Write("ipconfig /all\r\n");
p.StandardInput.Write("exit\r\n");
textBox1.Text=p.StandardOutput.ReadToEnd();
System.Diagnostics.Process p=new System.Diagnostics.Process();
p.StartInfo.UseShellExecute=false;
p.StartInfo.RedirectStandardInput=true;
p.StartInfo.RedirectStandardOutput=true;
p.StartInfo.CreateNoWindow=true;
p.StartInfo.FileName="ipconfig.exe";
p.StartInfo.Arguments = "/all";
p.Start();
string Text=p.StandardOutput.ReadToEnd();
p.WaitForExit();
// p.StartInfo.FileName="cmd.exe";
// p.StandardInput.Write("ipconfig /all\r\n");
// p.StandardInput.Write("exit\r\n");