using System.Net;
try
{
IPHostEntry iphosts=Dns.Resolve(textBoxInput.Text);
foreach(IPAddress ip in iphosts.AddressList)
{
long Address=ip.Address;
this.listBoxIPs.Items.Add(Address.ToString());
this.listBoxIPs.Items.Add(" "+ip.ToString());
}
textBoxHostName.Text=iphosts.HostName;
}
catch(Exception ex)
{
MessageBox.Show("Can't Access"+ex.Message,"Exception");
}
try
{
IPHostEntry iphosts=Dns.Resolve(textBoxInput.Text);
foreach(IPAddress ip in iphosts.AddressList)
{
long Address=ip.Address;
this.listBoxIPs.Items.Add(Address.ToString());
this.listBoxIPs.Items.Add(" "+ip.ToString());
}
textBoxHostName.Text=iphosts.HostName;
}
catch(Exception ex)
{
MessageBox.Show("Can't Access"+ex.Message,"Exception");
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货