在Win32程序中能操作DOS控制台的程序吗? 可以,运行进程的时候重定向输入输出,用Process.StandardOutput和Process.StandardInput来控制。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用netstat命令取得网络连接:Process proc = new Process();ProcessStartInfo info = new ProcessStartInfo();info.CreateNoWindow=true;info.RedirectStandardOutput=true;info.UseShellExecute=false;info.FileName="netstat";info.Arguments=" -n";proc.StartInfo=info;proc.Start();StreamReader reader = proc.StandardOutput;string content = reader.ReadToEnd();reader.Close();你修改以下就能用了 在.NET程序中使用PIPE(管道技术) http://blog.sunmast.com/sunmast/articles/211.aspx http://dev.csdn.net/develop/article/22/22865.shtm. C# Winfrom下如何实现定时显示数据库数据表 C# 报表生成器 给个思路! 简单的正则表达式的问题 两句话的区别?? 怎么让combobox自动展开,------绝对放分! C#如何引用Excel 2003 COM组件? 如果要用Context.Server.MapPath(),需要using 什么 List 的 Find() 设计之失 在C#中怎么样显示一个MessageBox? c#中的delegate和c++中的模版一样吗? XDE中的顺序图如何添加对象间的消息啊? 如何配置.net程序的IIS,在线等待
Process proc = new Process();
ProcessStartInfo info = new ProcessStartInfo();
info.CreateNoWindow=true;info.RedirectStandardOutput=true;
info.UseShellExecute=false;
info.FileName="netstat";
info.Arguments=" -n";
proc.StartInfo=info;proc.Start();
StreamReader reader = proc.StandardOutput;
string content = reader.ReadToEnd();
reader.Close();
你修改以下就能用了
http://blog.sunmast.com/sunmast/articles/211.aspx