SocketException caught!!!Source : SystemMessage : The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for .
string IpAddressString = "64.187.125.151"; try { IPAddress hostIPAddress = IPAddress.Parse(IpAddressString); IPHostEntry hostInfo = Dns.GetHostByAddress("64.187.125.151"); // 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; Response.Clear(); Response.Write("Host name : " + hostInfo.HostName); Response.Write("\nAliases :"); for (int index = 0; index < alias.Length; index++) { Response.Write(alias[index]); } Response.Write("\nIP address list : "); for (int index = 0; index < address.Length; index++) { Response.Write(address[index]); } } catch (SocketException e) { Response.Write("SocketException caught!!!"); Response.Write("Source : " + e.Source); Response.Write("Message : " + e.Message); } catch (FormatException e) { Response.Write("FormatException caught!!!"); Response.Write("Source : " + e.Source); Response.Write("Message : " + e.Message); } catch (ArgumentNullException e) { Response.Write("ArgumentNullException caught!!!"); Response.Write("Source : " + e.Source); Response.Write("Message : " + e.Message); } catch (Exception e) { Response.Write("Exception caught!!!"); Response.Write("Source : " + e.Source); Response.Write("Message : " + e.Message); } Console.ReadLine();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)