?? networking.cs
字號:
?namespace LicenseManage.BaseClasses
{
using System.Net;
class NetWorking
{
private static string IPmaotao;
public static string getHostIp()
{
IPAddress[] addresses = Dns.GetHostEntry(Dns.GetHostName()).AddressList;
foreach (IPAddress address in addresses)
{
if (IniInfo.UseSubNet) //if ini is set to use the subnet
{
if (address.AddressFamily.ToString() == "InterNetwork") // is the ip interNetWork? not local or V6
{
bool found = false;
if (IniInfo.IPs.Contains(address.ToString()))
{
found = true;
}
if (found)
IPmaotao = address.ToString();
}
}
else
if (!IniInfo.UseSubNet)
{
if (address.AddressFamily.ToString() == "InterNetwork")
{
IPmaotao = address.ToString();
}
}
}
return IPmaotao;
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -