public static string GetIp()
{
IPHostEntry MyIp = new IPHostEntry();
//MyIp = Dns.Resolve(Dns.GetHostName());
MyIp = Dns.Resolve(Dns.GetHostName());
if (MyIp.AddressList.Length == 1)
{
return MyIp.AddressList[0].ToString();
}
else
{
return MyIp.AddressList[1].ToString();
}
}
{
IPHostEntry MyIp = new IPHostEntry();
//MyIp = Dns.Resolve(Dns.GetHostName());
MyIp = Dns.Resolve(Dns.GetHostName());
if (MyIp.AddressList.Length == 1)
{
return MyIp.AddressList[0].ToString();
}
else
{
return MyIp.AddressList[1].ToString();
}
}