日期:2014-05-17 浏览次数:20881 次
m_server.IpAddress = Dns.GetHostEntry(Dns.GetHostName()).AddressList[0];
遍历AddressList
if(Dns.GetHostEntry(Dns.GetHostName()).AddressList[i].AddressFamily == AddressFamily.InterNetwork)
{
m_server.IpAddress=Dns.GetHostEntry(Dns.GetHostName()).AddressList[i];
break;
}