怎么才能知道remoting的地址可不可用,没有remoting的专栏,谢谢了 RT 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ping 一下这个地址就可以了。。 Process p = new Process(); p.StartInfo.FileName = "cmd.exe"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardInput = true; p.StartInfo.RedirectStandardOutput = true; p.StartInfo.RedirectStandardError = true; p.StartInfo.CreateNoWindow = true; string pingrst; p.Start(); p.StandardInput.WriteLine("ping -n 1 "+strIp); p.StandardInput.WriteLine("exit"); string strRst = p.StandardOutput.ReadToEnd(); if(strRst.IndexOf("(0% loss)")!=-1) pingrst = "连接"; else if( strRst.IndexOf("Destination host unreachable.")!=-1) pingrst = "无法到达目的主机"; else if(strRst.IndexOf("Request timed out.")!=-1) pingrst = "超时"; else if(strRst.IndexOf("Unknown host")!=-1) pingrst = "无法解析主机"; else pingrst = strRst; p.Close(); return pingrst; winform通过webbrowser使用百度地图提示'BMap'未定义 求助 c#中怎样添加closing事件 远程管理上十万台机器有没有可能 c#从oracle导出excel文件 Ajax问题 treeview与框架数据更新问题 初到宝地,请多指教!高手请进:DataGrid模板列文本框求和问题 透明图片的问题!急! wpf窗体按钮取数据库数据,添加配置文件后获取不了连接字符串后窗体启动失败 C#中索引器和数组的区别? 类似盗取QQ的程序 怎么用C#实现类似酷狗2007那样的主菜单?
p.StartInfo.FileName = "cmd.exe";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.CreateNoWindow = true;
string pingrst;
p.Start();
p.StandardInput.WriteLine("ping -n 1 "+strIp);
p.StandardInput.WriteLine("exit");
string strRst = p.StandardOutput.ReadToEnd();
if(strRst.IndexOf("(0% loss)")!=-1)
pingrst = "连接";
else if( strRst.IndexOf("Destination host unreachable.")!=-1)
pingrst = "无法到达目的主机";
else if(strRst.IndexOf("Request timed out.")!=-1)
pingrst = "超时";
else if(strRst.IndexOf("Unknown host")!=-1)
pingrst = "无法解析主机";
else
pingrst = strRst;
p.Close();
return pingrst;