string strHostName = Dns.GetHostName(); //得到本机的主机名
IPHostEntry ipEntry = Dns.GetHostEntry(strHostName); //取得本机IP
bool ischange = true;
string path = Application.StartupPath;
for (int i = 0; i < ipEntry.AddressList.Length; i++)
{
string strAddr = ipEntry.AddressList[i].ToString();
}
或者
ips = Dns.GetHostAddresses(strHostName); //取得本机IP
string path = Application.StartupPath;
for (int i = 0; i < ips.Length; i++)
{
string strAddr = ips[i].ToString();
}
都不得不到
但用mfc写的程序可以得到
IPHostEntry ipEntry = Dns.GetHostEntry(strHostName); //取得本机IP
bool ischange = true;
string path = Application.StartupPath;
for (int i = 0; i < ipEntry.AddressList.Length; i++)
{
string strAddr = ipEntry.AddressList[i].ToString();
}
或者
ips = Dns.GetHostAddresses(strHostName); //取得本机IP
string path = Application.StartupPath;
for (int i = 0; i < ips.Length; i++)
{
string strAddr = ips[i].ToString();
}
都不得不到
但用mfc写的程序可以得到
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货