locked
Account ID issue RRS feed

  • Question

  • User364663285 posted

    Dear,
    What to adjust (to the codes) below, due to such error?

    Your account ID or license key could not be authenticated. at MaxMind.GeoIP2.WebServiceClient.HandleResponse[T](Response response) at MaxMind.GeoIP2.WebServiceClient.Execute[T](String type, IPAddress ipAddress) at MaxMind.GeoIP2.WebServic

                    SqlConnection conn3g = new SqlConnection(ConfigurationManager.ConnectionStrings["Mssqlconn3"].ConnectionString);
                    conn3g.Open();
                    try
                    {
                        String format = @"MM\/dd\/yyyy HH:mm:ss";
                        //SqlCommand cmd3g = new SqlCommand("insert into err values('777pp" + Convert.ToString(rec_id) +"--"+lb_house_id.Text+"--"+cmd6.CommandText+ "',2,getdate()) ", conn3g);
                        using (var client = new WebServiceClient(42, "license_key"))
                        {
                            // Do the lookup
                            var response = client.Country("128.101.101.101");
    
                            Console.WriteLine(response.Country.IsoCode);        // 'US'
                            Console.WriteLine(response.Country.Name);           // 'United States'
                            Console.WriteLine(response.Country.Names["zh-CN"]); // '美国'
                        }
                        SqlCommand cmd3g = new SqlCommand("insert into err values('99ii" + IPAddress + "',2,getdate()) ", conn3g);
    
                        cmd3g.ExecuteNonQuery();
    

    Friday, September 21, 2018 10:02 AM

Answers

  • User753101303 posted

    Hi,

    The message is quite clear. 42 and "license_key" are likely wrong.

    If this is sample code, you likely have to subscribe and get your own values. If you changed them to avoid to disclose them, triple check in your original source code that you are using the correct values maybe using links found at https://dev.maxmind.com/geoip/geoip2/web-services/#Authorization

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, September 22, 2018 8:37 AM

All replies