Hey,
I'm facing a very peculiar problem, I am using google maps API for a webpage.
The objective is to get the Google Pin point on the Map for the addresses that the user has entered. While doing this I get the following error
"THE REMOTE SERVER RETURNED AN ERROR - 403 FORBIDDEN"
Occasionally it does works fine (but on my local system it always works).
I am using the following code to get the reference from Google API (i.e., longitude,latitude)
WebRequest objWebRequest = WebRequest.Create(geoURL);
WebResponse objWebResponse = objWebRequest.GetResponse();
Stream objWebStream = objWebResponse.GetResponseStream();
using (StreamReader objStreamReader = new StreamReader(objWebStream))
{
csvValues = objStreamReader.ReadToEnd();
}
if (!(string.IsNullOrEmpty(csvValues)))
{
Match coord = Regex.Match(csvValues, "<coordinates>.*</coordinates>");
if (!coord.Success) return "";
return coord.Value.Substring(13, coord.Length - 27);
}
Does any one have a solution?
Error Details:
SOURCE : System
MESSAGE : The remote server returned an error: (403) Forbidden.
TARGETSITE : System.Net.WebResponse GetResponse()
STACKTRACE : at System.Net.HttpWebRequest.GetResponse() at
clsGetAreaLatLng.LocationGeoCode(String geoURL)