2012-10-11 79 views

回答

2

您是否嘗試過加入這個以您的解決方案

<system.net> 
    <defaultProxy enabled="true" useDefaultCredentials="true"> 
    <proxy bypassonlocal="True" proxyaddress="http://webproxy:80" /> 
    </defaultProxy> 
</system.net> 

或嘗試以下

string url = 「Valid URL」; 
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); 
NetworkCredential netcredit = new NetworkCredential(「user1″, 「pass」, 「domain」); 
req.Credentials = netcredit; 
System.Net.WebProxy pry = new WebProxy(「proxyServer」,true); 
pry.Credentials = netcredit; 
WebRequest.DefaultWebProxy = pry; 
req.Method = 「HEAD」; //Does not work if this line is not used 
HttpWebResponse res = (HttpWebResponse)req.GetResponse(); 

HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url); 
NetworkCredential netcredit = new NetworkCredential(「user1″, 「pass」, 「domain」); 
req.Credentials = netcredit; 
System.Net.WebProxy pry = new WebProxy(「proxyServer」,true); 
pry.Credentials = netcredit; 
req.Proxy = pry; 
req.Method = 「HEAD」; //Does not work if this line is not used 
HttpWebResponse res = (HttpWebResponse)req.GetResponse(); 

人們在這個論壇的解決方案

https://groups.google.com/forum/?fromgroups=#!topic/google-maps-api/0js1jr4kqJw

+0

謝謝。上面的代碼讓我通過這一行發現錯誤,但我的Google Web服務仍然無法正常工作。它返回給我一個對象,但現在拋出這個錯誤:「解析值時遇到意外的字符:<。路徑」,第0行,位置0。 – user1734006

+0

我認爲它的代理服務器出了問題。我是否需要配置代理以映射maps.googleapis.com域名? – user1734006