using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.Sockets;
class ResolveDNS
{
IPAddress[] m_arrayIPs;
public void Resolve(string s_host)
{
IPHostEntry ip = Dns.GetHostEntry(s_host);
m_arrayIPs = ip.AddressList;
}
public IPAddress this[int nIndex]
{
get
{
return m_arrayIPs[nIndex];
}
}
public int IPLength
{
get
{
return m_arrayIPs.Length;
}
}
}
namespace _81105_test2_console
{
class Program
{
static void Main(string[] args)
{
ResolveDNS resolver1 = new ResolveDNS();
resolver1.Resolve("www.sysbcs.com");
int n = resolver1.IPLength;
Console.WriteLine("Get the IP Address of the host");
Console.WriteLine();
for (int i = 0; i < n; i++)
{
Console.WriteLine(resolver1[i]);
}
while (true) ;
}
}
}