Ejemplo n.º 1
0
 public void LocateAddress(IPAddress address)
 {
     Logger.LogTrace($"address=|{address.ToString()}|");
     if (!IPAddress.IsLoopback(address))
     {
         try
         {
             GeolocationParams geoParams = new GeolocationParams();
             geoParams.SetIp(address.ToString());
             geoInfo = Api.GetGeolocation(geoParams);
             if (geoInfo.GetStatus() != (int)HttpStatusCode.OK)
             {
                 Logger.LogError(geoInfo.GetMessage());
             }
         } catch (Exception e)
         {
             Logger.LogError($"Can't initialize IPGeolocation: |{e.Message}|");
         }
     }
 }