吾爱破解 - 52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 7817|回复: 14
收起左侧

[其他转载] 手机号码归属地查询

[复制链接]
Demo 发表于 2014-8-20 12:30
本帖最后由 Demo 于 2014-8-20 12:43 编辑

[Visual Basic] 纯文本查看 复制代码
'Demo
'吾爱破解
'转载请保持完整出处
'http://www.52pojie.cn/space-uid-153321.html
Function HttpGet(url)

    With CreateObject("Msxml2.ServerXMLHTTP")
        .open "GET", url, False
        .send
        HttpGet = .responseText
    End With

End Function

Private Sub Command1_Click()
    PhoneNumber = ""
    All = HttpGet("http://wap.ip138.com/sim_search138.asp?mobile=" & PhoneNumber)
    a = Split(All, "归属地:")
    a = a(1)
    a = Split(a, "<br/>")
    a = a(0)
    MsgBox a
    
    b = Split(All, "卡类型:")
    b = b(1)
    b = Split(b, "<br/>")
    b = b(0)
    MsgBox b
    
End Sub

点评

这东西在论坛满大街都是  发表于 2014-8-20 14:39

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

gdyabc 发表于 2016-4-7 22:20
[Visual Basic] 纯文本查看 复制代码
Option Explicit
Private Sub Form_Load()
Debug.Print getphonedata("13800138000")
End Sub
Public Function getphonedata(strphone As String) As String
On Error Resume Next
Dim global_NetworkAddress As Object
Dim targetUrl As String, cardLocal As String, cardType As String, codeZip As String
Dim i As Byte
    targetUrl = "http://m.ip138.com/mobile.asp?mobile=" & strphone    '//从这里提取外网数据
    Set global_NetworkAddress = CreateObject("MSXML2.SERVERXMLHTTP")  '//创建xmlHttp对象
      With global_NetworkAddress
            Do
                   i = i + 1: Err.Clear                          '//记录Try的次数,并清空Err信息
                  .Open "GET", targetUrl, False
                  .Send
            Loop Until i = 4 Or Err.Number = 0     '//如果第一次获取失败,再尝试3次
            '//如果获取成功就返回OK,失败返回错误信息
            getphonedata = IIf(Err.Number = 0, "OK", Err.Description)
            cardLocal = Split(Split(.ResponseText, "卡号归属地</td><td><span>")(1), "</span>")(0)
            cardType = Split(Split(.ResponseText, "卡 类 型</td><td><span>")(1), "</span>")(0)
            codeZip = Split(Split(.ResponseText, "邮 编</td><td><span>")(1), "</span>")(0)
            getphonedata = getphonedata & "," & strphone & "," & _
                           cardLocal & "," & cardType & "," & codeZip
      End With
Set global_NetworkAddress = Nothing       '//释放对象
End Function
东苑 发表于 2014-8-20 12:48
淡然出尘 发表于 2014-8-20 12:36
 楼主| Demo 发表于 2014-8-20 12:43
淡然出尘 发表于 2014-8-20 12:36
用WAP确实可以省不少事

WWW返回的格式经常变,不懂怎么处理。
yang10560 发表于 2014-8-20 13:06
不错。。。。。亲测可行
1013356744 发表于 2014-8-20 13:14
虽然用不上但还是支持一下
yang10560 发表于 2014-8-20 13:28
[Visual Basic] 纯文本查看 复制代码
Function HttpGet(url)

With CreateObject("Msxml2.ServerXMLHTTP")
  .open "GET", url, False
  .send
  
  HttpGet = .responseText
End With

End Function

Private Sub Command1_Click()
PhoneNumber = "13804452101"
All = HttpGet("http://wap.ip138.com/sim_search138.asp?mobile=" & PhoneNumber)


s = InStr(All, "归属地:")
q = InStr(s, All, "<br/>")
f = Mid(All, s, q - s)
Print f

s = InStr(All, "卡类型:")
q = InStr(s, All, "<br/>")
f = Mid(All, s, q - s)
Print f


End Sub

点评

值得学习  发表于 2014-8-20 14:03

免费评分

参与人数 1热心值 +1 收起 理由
Demo + 1 我很赞同!

查看全部评分

 楼主| Demo 发表于 2014-8-20 16:14
@ruoxin  找份VB代码出来。立马20CB给你!

点评

问度娘呗  发表于 2014-8-20 18:45
 楼主| Demo 发表于 2014-8-20 16:15
@ruoxin  找份VB代码出来。立马20CB给你!
opelwang 发表于 2015-3-21 14:16
在线通过IP138完成的,不错,学习一下。
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则

返回列表

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-11-15 15:30

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表