获取本机ip
///
/// 获取本机ip
///
///
public static string getLocalIP()
{
string strHostName = DNS.GetHostName(); //得到本机的主机名
IPHostEntry ipEntry = Dns.GetHostByName(strHostName); //取得本机IP
string strAddr = ipEntry.AddressList[0].ToString();
return (strAddr);
}
/// 获取本机ip
///
///
public static string getLocalIP()
{
string strHostName = DNS.GetHostName(); //得到本机的主机名
IPHostEntry ipEntry = Dns.GetHostByName(strHostName); //取得本机IP
string strAddr = ipEntry.AddressList[0].ToString();
return (strAddr);
}
本文标题:获取本机ip
当前地址:http://scyingshan.cn/article/iidccj.html