/// <summary>/// 获取本机ip/// </summary>/// <returns></returns>public static string getLocalIP()
{
string strHostName =
Dns.GetHostName();
//得到本机的主机名 IPHostEntry ipEntry = Dns.GetHostByName(strHostName);
//取得本机IP string strAddr = ipEntry.AddressList[0].ToString();
return (strAddr);
}