2017-07-07 71 views
-1

當我把這個網址在瀏覽器中,我得到一個答案:https://maps.googleapis.com/maps/api/geocode/xml?address=15838+Am%20Mellensee%20OT%20Mellensee+Hauptstra%C3%9Fe%2016谷歌的地理編碼API返回「零個結果」,在C#

但在C#我得到「零個結果」: 的DataSet DS =新的DataSet() ; ds.ReadXml(「https://maps.googleapis.com/maps/api/geocode/xml?address=15838+Am%20Mellensee%20OT%20Mellensee+Hauptstra%C3%9Fe%2016」);

它早期工作正常! 有沒有人有想法?不編碼空格和其他特殊符號

回答

0

認沽字符串地址一樣

var str = "https://maps.googleapis.com/maps/api/geocode/xml?address=15838+Am Mellensee OT Mellensee+Hauptstra"; 
ds.ReadXml(str); 
+0

這是我第一次嘗試。沒有成功!但是當我忽略'OT ...'時,我發現它很有效。但爲什麼在瀏覽器URL中使用它?我認爲它是同一臺機器。 –

相關問題