IsLocalIpAddress() статический приватный Метод

static private IsLocalIpAddress ( IPAddress remoteAddress ) : bool
remoteAddress System.Net.IPAddress
Результат bool
Пример #1
0
        } // ReleaseControl

        // Determines if the remote connection is from localhost.
        internal bool IsLocalhost()
        {
            if (NetSocket == null || NetSocket.RemoteEndPoint == null)
            {
                return(true);
            }

            IPAddress remoteAddr = ((IPEndPoint)NetSocket.RemoteEndPoint).Address;

            return(IPAddress.IsLoopback(remoteAddr) || CoreChannel.IsLocalIpAddress(remoteAddr));
        } // IsLocalhost
 internal bool IsLocalhost()
 {
     if ((this.NetSocket != null) && (this.NetSocket.RemoteEndPoint != null))
     {
         IPAddress address = ((IPEndPoint)this.NetSocket.RemoteEndPoint).Address;
         if (!IPAddress.IsLoopback(address))
         {
             return(CoreChannel.IsLocalIpAddress(address));
         }
     }
     return(true);
 }