public static void Main(String[] args)
 {
     //open the database
     try
     {
         LookupService ls = new LookupService("/usr/local/share/GeoIP/GeoIPCity.dat", LookupService.GEOIP_STANDARD);
         //get city location of the ip address
         if (args.Length > 0)
         {
             Location l = ls.getLocation(args[0]);
             if (l != null)
             {
                 Console.Write("country code " + l.countryCode + "\n");
                 Console.Write("country name " + l.countryName + "\n");
                 Console.Write("region " + l.region + "\n");
                 Console.Write("city " + l.city + "\n");
                 Console.Write("postal code " + l.postalCode + "\n");
                 Console.Write("latitude " + l.latitude + "\n");
                 Console.Write("longitude " + l.longitude + "\n");
                 Console.Write("metro code " + l.metro_code + "\n");
                 Console.Write("area code " + l.area_code + "\n");
                 Console.Write("region name " + l.regionName + "\n");
             }
             else
             {
                 Console.Write("IP Address Not Found\n");
             }
         }
         else
         {
             Console.Write("Usage: cityExample IPAddress\n");
         }
     }
     catch (System.Exception e)
     {
         Console.Write("Error" + e.Message + "\n");
     }
 }
        public static void Main(String[] args)
        {
            LookupService ls    = new LookupService("/usr/local/share/GeoIP/GeoIPNetSpeed.dat", LookupService.GEOIP_STANDARD);
            int           id    = ls.getID(args[0]);
            int           speed = id;

            if (speed == LookupService.GEOIP_UNKNOWN_SPEED)
            {
                Console.Write("Unknown \n");
            }
            else if (speed == LookupService.GEOIP_DIALUP_SPEED)
            {
                Console.Write("Dialup \n");
            }
            else if (speed == LookupService.GEOIP_CABLEDSL_SPEED)
            {
                Console.Write("Cable/DSL \n");
            }
            else if (speed == LookupService.GEOIP_CORPORATE_SPEED)
            {
                Console.Write("Corporate \n");
            }
        }