Example from .NET SDK Documentation
try
{
IPAddress hostIPAddress = IPAddress.Parse(IpAddressString);
IPHostEntry hostInfo = Dns.GetHostByAddress(hostIPAddress);
// Get the IP address list that resolves to the host names contained in
// the Alias property.
IPAddress[] address = hostInfo.AddressList;
// Get the alias names of the addresses in the IP address list.
String[] alias = hostInfo.Aliases;
Console.WriteLine("Host name : " + hostInfo.HostName);
Console.WriteLine("\nAliases :");
for(int index=0; index < alias.Length; index++) {
Console.WriteLine(alias[index]);
}
Console.WriteLine("\nIP address list : ");
for(int index=0; index < address.Length; index++) {
Console.WriteLine(address[index]);
}
}
catch(SocketException e)
{
Console.WriteLine("SocketException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(FormatException e)
{
Console.WriteLine("FormatException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(ArgumentNullException e)
{
Console.WriteLine("ArgumentNullException caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
catch(Exception e)
{
Console.WriteLine("Exception caught!!!");
Console.WriteLine("Source : " + e.Source);
Console.WriteLine("Message : " + e.Message);
}
In your case just replace console output to your needs.
"Franco Figún" <fr*****@fibertel.com.ar> wrote in message
news:eK**************@tk2msftngp13.phx.gbl...
Do you have a example? I never use before....
Thanks
--
FF
www.francofigun.com.ar
www.microsofties.com.ar
Yahoo MSN: fr******@yahoo.com.ar
"Jonathan Allen" <X@X> escribió en el mensaje
news:u4**************@tk2msftngp13.phx.gbl... Look at the DNS class.
--
Jonathan Allen
"Franco Figún" <fr*****@fibertel.com.ar> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... > Hi everyone
> I need to simulate NSLOOKUP but with asp.net in c# o vb.net, any idea?
> I don't need a very complex example, only 2 textbox for the domain and
other > for the DNS server, and one button, that's all.
> Any help?
> Thanks
>
> --
> FF
> www.francofigun.com.ar
> www.microsofties.com.ar
> Yahoo MSN: fr******@yahoo.com.ar
>
>