提供一款asp,xmlhttp实现的手机号码归属地查询源码哦,你可以看看这款代码是不是适合你哦,好了费话不说多了来看看吧。
Class clsSteal
Private src_ '采集的目标URL
Private prm_ '传入的POST或GET参数
Private enc_ '字符编码
Private value_ '采集的内容
private sub class_initialize()
src_=""
prm_=""
enc_="GB2312"
value_=""
end sub
private sub class_terminate()
end sub
public property let src(str)
src_=str
end property
public property let rqst(str)
prm_=str
end property
public property let enc(str)
enc_=str
end property
public property get value
value=value_
end property
public sub send(pMethod)
if src_="" then
value_="src属性不能为空"
exit sub
end if
On Error Resume Next
dim Http
set Http=server.createobject("MSXML2.XMLHTTP")
if UCase(pMethod)="POST" then
Http.open "POST",src_ ,false
Http.setRequestHeader "Content-Length",Len(prm_)
Http.setRequestHeader "CONTENT-TYPE","application/x-www-form-urlencoded"
Http.send(prm_)
else
Http.open "GET",src_ ,false
Http.send()
end if
if Http.readystate4 then exit sub
value_=BytesToBSTR(Http.responseBody)
value_=lcase(value_)
set http=nothing
if err.number0 then err.Clear
end sub
private function BytesToBstr(body)
dim oSTM
set oSTM = Server.CreateObject("adodb.stream")
oSTM.Type = 1
oSTM.Mode =3
oSTM.Open
oSTM.Write body
oSTM.Position = 0
oSTM.Type = 2
oSTM.Charset = enc_
BytesToBstr = oSTM.ReadText
oSTM.Close
set oSTM = nothing
end function
public sub cut(strBeg,strEnd)
iH=instr(lcase(value_) , strBeg)
iB=instr(lcase(value_) , strEnd)
if iH>0 and iB>0 then value_=mid(value_ , iH+len(strBeg), iB-iH-len(strEnd))
end sub
public sub exch(strOld,strNew)
value_=replace(value_ , strOld, strNew)
end sub
end class
%>
Dim mySTL,outstr,url,vPost,vMethod
Dim aryText '//文本数据
Dim aStr,vHTML
vPost=Request.Form("hiCode")
set mySTL=new clsSteal
mySTL.src="http://www.hi53***60.com/open/Tool1.0.asp?t=mobile&c="&vPost
mySTL.send("GET")
aryText=mySTL.value
Set mySTL=nothing
response.write("
现,采集的字符串数据为 “" &Replace(aryText,"","$")& "”
" )
response.write("
今,转化成数组后的各项数据如下:")
aStr=Split(aryText,"")
For i=0 To UBound(aStr)-1
vHTML=vHTML& " [" &i& "] " &aStr(i)& ""
Next
response.write(vHTML)
%>
css" type=text/css rel=stylesheet>
| 手机号码段 | |
| 卡号归属地 | |
| 卡类型 | |
| 区 号 | |
| 邮 编 |
站长更多常用工具在线查询
| | | | | | | |
站长常用工具下载