System.Net.Dns.Dns.GetHostEntry C# (CSharp) Method

GetHostEntry() public static method

public static GetHostEntry ( string hostNameOrAddress ) : IPHostEntry
hostNameOrAddress string
return IPHostEntry
		static IPHostEntry GetHostEntry (string hostNameOrAddress)
		{
			if (hostNameOrAddress == null)
				throw new ArgumentNullException ("hostNameOrAddress");
			if (hostNameOrAddress == "0.0.0.0" || hostNameOrAddress == "::0")
				throw new ArgumentException ("Addresses 0.0.0.0 (IPv4) " +
					"and ::0 (IPv6) are unspecified addresses. You " +
					"cannot use them as target address.",
					"hostNameOrAddress");

			IPAddress addr;
			if (hostNameOrAddress.Length > 0 && IPAddress.TryParse (hostNameOrAddress, out addr))
				return GetHostEntry (addr);

			return GetHostByName (hostNameOrAddress);
		}

Same methods

Dns.Dns::GetHostEntry ( IPAddress address ) : IPHostEntry