GetHostByAddress() private méthode

private GetHostByAddress ( IPAddress address ) : IPHostEntry
address IPAddress
Résultat IPHostEntry
Exemple #1
0
        public static IPHostEntry Resolve(string hostName)
        {
            if (hostName == null)
            {
                throw new ArgumentNullException("hostName");
            }
            IPHostEntry iphostEntry = null;

            try
            {
                iphostEntry = Dns.GetHostByAddress(hostName);
            }
            catch
            {
            }
            if (iphostEntry == null)
            {
                iphostEntry = Dns.GetHostByName(hostName);
            }
            return(iphostEntry);
        }