GetHostByAddress() 개인적인 메소드

private GetHostByAddress ( IPAddress address ) : IPHostEntry
address IPAddress
리턴 IPHostEntry
예제 #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);
        }