hi..
i want to get visitors ip address and based on the ip address i want to get country details of the visitors.
i will get users ip address and by passing the ip address to a method i am facing the problem.
i was using the below url in order to retrieve the country deatils
http://freegeoip.appspot.com
but normally i goes to this url . it thorws the following message
"App Engine Error
Over Quota
This Google App Engine application is temporarily over its serving quota. Please try again later."
so how to handle this.
i have to get the country details based on the ip address.
so please provide me some help regarding this issue.
Fetch country based on ip address code is below:
private DataTable GetGeoLocation(string ipaddress)
{
//Create a WebRequest
WebRequest rssReq = WebRequest.Create("http://freegeoip.appspot.com/xml/"
+ ipaddress);
//Create a Proxy
WebProxy px = new WebProxy("http://freegeoip.appspot.com/xml/" + ipaddress, true);
//Assign the proxy to the WebRequest
rssReq.Proxy = px;
//Set the timeout in Seconds for the WebRequest
rssReq.Timeout = 2000;
try
{ //Get the WebResponse
WebResponse rep = rssReq.GetResponse();
//Read the Response in a XMLTextReader
XmlTextReader xtr = new XmlTextReader(rep.GetResponseStream());
//Create a new DataSet
DataSet ds = new DataSet();
//Read the Response into the DataSet
ds.ReadXml(xtr);
return ds.Tables[0];
}
catch
{
return null;
}
}
it returns only "null" due to that url not opening .
regards
gopal.s