代理上网,Dns.GetHostEntry(“www.baidu.com”).AddressList[0].ToString()出错,怎么解决?
解决方案 »
- 急!DataGridView排序问题
- 关于主从表后台更新的问题((前台extjs的store 和后台c#))?
- 总是提示我这句话
- 界面控制问题,大哥们帮帮忙~~~~~~~~~~~~~~~~
- 如何实现把一整形数组里边所有的三个到7个的数字组合都找出来??
- ThreadAbortException 异常 SNINativeMethodWrapper.SNIPacketGetConnection(IntPtr packet)
- 这里有一个QQ群(1700181),希望你在共同制作项目的过程中,得到更多你想要的,而过程却更加轻松...
- 这次WEB应用程序拷到别的机子上为什么出错。能前都能解决的呀。。。请进。。
- 制作一个asp.net的B\C网站
- TeeChart控件
- 救急
- 复制datagridview单元格中的内容
start.Arguments = "www.baidu.com -n 1"; //设置命令参数
start.CreateNoWindow = true; //不显示dos命令行窗口
start.RedirectStandardOutput = true; //
start.RedirectStandardInput = true; //
start.UseShellExecute = false; //是否指定操作系统外壳进程启动程序
Process p = Process.Start(start);
StreamReader reader = p.StandardOutput; //截取输出流
string line = reader.ReadLine();
line = reader.ReadLine();
string result = Regex.Match(line, @"(?<=\[)[\d.]+").Value;//result就是你要的ip地址
IPAddress ip = IPAddress.Parse(result);//转换为IPAddress