如何简单的获取服务器端IP地址
?
[解决办法]
简单获取就是ping一下
要不就:
private void ButtonIP_Click(object sender, System.EventArgs e)
{ Syste m.Net.IPAddress[] addressList = Dns.GetHostByName(Dns.GetHostName()).AddressList;if ( addressList.Length> 1){ TextLIP.Text = addressList[0].ToString();TextSIP.Text = addressList[1].ToString();}else{TextLIP.Text = addressList[0].ToString();TextSIP.Text = "没有可用的连接 ";}}