批处理之家's Archiver

victorwoo 发表于 2014-10-20 09:34

PowerShell 技能连载 - 获取美国邮政编码

原始链接:[url=http://blog.vichamp.com/powershell/tip/2014/10/13/getting-us-zip-codes/]PowerShell 技能连载 - 获取美国邮政编码[/url]
发表日期:2014-10-13
[hr]
[i]适用于 PowerShell 所有版本[/i]

是否曾需要查找某个(美国)城市的邮政编码,或者反过来通过邮政编码查找城市的名称?

只需要简单地用 PowerShell 连接到一个免费的 Web Service 就可以获得这些信息:[code]
$webservice = New-WebServiceProxy -Uri 'http://www.webservicex.net/uszip.asmx?WSDL'
$webservice.GetInfoByCity('New York').Table
$webservice.GetInfoByZIP('10286').Table
[/code]本文国际来源:[url=http://powershell.com/cs/blogs/tips/archive/2014/10/13/getting-us-zip-codes.aspx]Getting US ZIP Codes[/url]

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.