本文介绍了从邮政编码自动填写城市和州的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! Hello Experts, 有什么方法可以用邮政编码自动填写城市和州吗? 我想用一些非常简单的东西。 我在google中看到了一些结果大多数他们是AJAX通话,我们不想这样做。 我会很感激教程/代码/推荐链接。 我也愿意接受建议 谢谢Hello Experts,Is there any way that I can auto fill City and State with Zip code ?I wanted to use something really simple.I have seen some results in google where most of them were with AJAX calls, which we don't want to do it.I would appreciate tutorials/ code/ referral link.I am also open to suggestionsThanks推荐答案Dim ds As New DataSet() Dim url As String = "http://maps.google.com/maps/api/geocode/xml?address=" + txtZip.Text + "&sensor=false" Dim request As System.Net.WebRequest = System.Net.WebRequest.Create(url) Using response As System.Net.WebResponse = DirectCast(request.GetResponse(), System.Net.HttpWebResponse) Using reader As New System.IO.StreamReader(response.GetResponseStream(), Encoding.UTF8) ds.ReadXml(reader) Dim dt As DataTable = ds.Tables("result") Dim strspliaddress = dt.Rows(0)("formatted_Address").ToString().Split(",") txtcity.Text = strspliaddress(0)txtState.Text= strspliaddress(1)'Something like this 这篇关于从邮政编码自动填写城市和州的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
09-06 06:25