查询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--"
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值