星期三, 12月 02, 2009

C# 取得本機ip

string strHostIP = "";
IPHostEntry oIPHost = Dns.GetHostEntry(Environment.MachineName);
if (oIPHost.AddressList.Length > 0)
{
strHostIP = oIPHost.AddressList[0].ToString();
}

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails