using System;
using System.Net;
using System.Net.Sockets;
public class multicast
{
static void Main()
{
Console.WriteLine("请输入一个要解析的网址 :\n");
String ipa =Console.ReadLine();
try
{
IPAddress ipAddress = Dns.Resolve(ipa).AddressList[0];
Console.WriteLine(ipAddress.ToString());
}
catch(SocketException e)
{
Console.WriteLine("发生错误,错误信息:"+e.Message +"\n错误源: "+e.Source);
}
}
}
本文地址:http://com.8s8s.com/it/it42501.htm