看看我改的:namespace NKUtilities 
{
using System;
using System.Net; public class DNSUtility
{
public static void Main (string [] args)
{
string strHostName;
if (args.Length == 0)
{
// 首先得到本地机器的主机名称
strHostName = Dns.GetHostName();
Console.WriteLine ("Local Machine's Host Name: " + strHostName);
}
else
{
strHostName = args[0];
}
// 然后通过主机名称得到IP地址列表
IPHostEntry ipEntry = Dns.GetHostByName (strHostName);
IPAddress [] addr = ipEntry.AddressList;
for (int i = 0; i < addr.Length; i++)
{
Console.WriteLine ("IP Address {0}: {1} ", i, addr.ToString ());
}
System.Console.ReadLine ();

}
}-------------------------------------------    舟遥遥以轻扬    风飘飘而吹衣