微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

查询IP对应地区的WebService

记得网上有许多专门搜索Web Service 提供者的站点,可惜我找了半天才找到了 http://www.xmethods.com/这个网站,还是很幸运!一看,哇哈多啊,随便找个 IP2Location IP Address Geolocation Web Service using SOAP,明白了是可以提供IP查询的WEB Service 马上到 http://www.fraudlabs.com/default.aspx注册个KEY(只要E-mail就OK),后到VS.NET2003添加WEB引用 http://ws.ip2location.com/ip2locationwebservice.asmx?wsdl   看提供的方法返回有查询IP,主机的国家,地区,国家,城市,国家代码,域名,纬度,经度,邮编   很好!   代码:   '作者:wgscd(自由奔腾)@ 2005   Dim key As String = "02-E39Y-A27K"'注意自己申请的KEY,这我的    Dim Input As String =textBox1.txt '记录IP    Dim IPlocation As com.ip2location.ws.IP2LOCATION    IPlocation = New com.ip2location.ws.IP2LOCATION    Dim ws1 As com.ip2location.ws.Ip2LocationWebService    ws1 = New com.ip2location.ws.Ip2LocationWebService    IPlocation = ws1.IP2Location(Input,key)    Me.Text = Input    If IPlocation.MESSAGE <> "" Then 'if some ERRO    Label6.Text = "哎呀!出错了。。"    MsgBox(" 错误信息:" & IPlocation.MESSAGE)    Else 'if no ERRO       Dim strResult As String = "国家:" & IPlocation.COUNTRYNAME & vbCrLf & "城市:" & IPlocation.CITY & vbCrLf & "国家代码:" & IPlocation.COUNTRYCODE & vbCrLf & "CREDITSAVAILABLE:" & IPlocation.CREDITSAVAILABLE & vbCrLf & "域名:" & IPlocation.DOMAINNAME & vbCrLf & "ISP名:" & IPlocation.ISPNAME & vbCrLf & "纬度:" & IPlocation.LATITUDE & vbCrLf & "经度:" & IPlocation.LONGITUDE & vbCrLf & "地区:" & IPlocation.REGION & vbCrLf & "邮编:" & IPlocation.ZIPCODE & vbCrLf & vbCrLf & vbCrLf & "--wgscd(自由奔腾)@ 2005--"

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐