用XMLHTTP来偷东西哈!
2018-09-06 12:03
只做了一部份,IP查询请大家自己照着我里边的样例自己完成吧!
演示:
<%@LANGUAGE=VBSCRIPTCODEPAGE=936%>
<html>
<head>
<metahttp-equiv=Content-Typecontent=text/html;charset=gb2312/>
<METANAME=AuthorCONTENT=goaler/>
<METANAME=KeywordsCONTENT=手机号码归属地,ip,googlepr,邮编,身份证,查询,升位,goaler,
<METANAME=DescriptionCONTENT=手机号码归属地,ip,googlepr,邮编,身份证,查询,升位,goaler,
<title>常用查询</title>
<styletype=text/css>
<!--
body{font:14pxTahoma,Verdana,宋体}
input,object{color:#000000;font:12pxTahoma,Verdana,宋体;}
form{margin:0}
A:link{COLOR:#000066;TEXT-DECORATION:none}
A:visited{COLOR:#000066;TEXT-DECORATION:none}
A:hover{COLOR:#FF8D00;TEXT-DECORATION:underline}
-->
</style>
<SCRIPTLANGUAGE=JavaScript>
<!--
String.prototype.Trim=function()
{
returnthis.replace(/(^\s*)(\s*$)/g,);
}
functioncheckMobile(){
varsMobile=document.mobileForm.MobileNumber.value.Trim();
if(!(/^13[0-9]\d{4,8}$/.test(sMobile))){
alert(请输入完整的11位手机号或手机号前七位);
document.mobileForm.MobileNumber.focus();
returnfalse;
}
}
functioncheckPR()
{
if(document.prForm.domainName.value.Trim()==)
{
returnfalse;
}
}
functioncheckZone2NumberForm()
{
if(document.Zone2NumberForm.zoneName.value.Trim()==)
{
alert(请输入地区名称!);
document.Zone2NumberForm.zoneName.focus();
returnfalse;
}
}
functioncheckNumber2ZoneForm()
{
varsZoneNumber=document.Number2ZoneForm.zoneNumber.value.Trim();
if(!(/^0\d{2,3}$/.test(sZoneNumber)))
{
alert(请输入3位或4位区号);
document.Number2ZoneForm.zoneNumber.focus();
returnfalse;
}
}
functioncheckIdentityForm()
{
varsIdentityNumber=document.identityForm.identityNumber.value.Trim();
if(!(/^\d{15}$^\d{18}$^\d{17}x$/.test(sIdentityNumber)))
{
alert(请输入15位或18位身份证号码);
document.identityForm.identityNumber.focus();
returnfalse;
}
}
functioncheckIdentityUpForm()
{
varsIdentityNumber=document.identityUpForm.identityNumber.value.Trim();
if(!(/^\d{15}$/.test(sIdentityNumber)))
{
alert(请输入15位身份证号码);
document.identityUpForm.identityNumber.focus();
returnfalse;
}
}
//-->
</SCRIPT>
</head>
<body>
<%
==========请保留以下信息===============
作者(Author):goaler
主页(homepage):
=======================================
onerrorresumenext
Dimurl,PostStr,sType,getContent,i
sType=Trim(Request.QueryString(sType))
%>
<fieldset>
<legend><strong>手机号归属地查询</strong></legend>
<div>
<%
DimMobileNumber
MobileNumber=Trim(Request.Form(MobileNumber))
%>
<divstyle=padding-left:23px;margin-bottom:8px;>
<formmethod=postname=mobileFormaction=searcher.asp?sType=mobileonsubmit=returncheckMobile()>
请输入手机号码段:<inputtype=textname=MobileNumbervalue=<%=MobileNumber%>onfocus=select()/><inputtype=submitid=subBtnvalue=查询/>
输入完整的11位手机号或手机号前七位
</form>
</div>
<%
IF(sType=mobileANDMobileNumber<>)THEN
DimgetArea,getType
PostStr=action=mobile&mobile=&MobileNumber
getContent=GetURL(
getArea=RegExpText(getContent,卡号归属地</TD>((.\n)*?)</TD>)
getType=RegExpText(getContent,卡类型</TD>((.\n)*?)</TD>)
Response.Write(<UL>)
Response.Write(<li><strong>手机号码段:</strong><fontcolor=#008000><strong>&MobileNumber&</strong></font></li>)
Response.Write(<li><strong>号码归属地:</strong><fontcolor=#008000><strong>&Replace(getArea,,,)&</strong></font></li>)
Response.Write(<li><strong>卡类型:</strong><fontcolor=#008000><strong>&Replace(getType,,,)&</strong></font></li>)
Response.Write(</UL>)
ENDIF
%>
</div>
</fieldset>
<fieldset>
<legend><strong>GooglePR值查询</strong></legend>
<div>
<%
DimdomainName
domainName=Replace(Replace(LCASE(Trim(Request.Form(domainName))),
%>
<divstyle=padding-left:23px;margin-bottom:8px;>
<formname=prFormmethod=postaction=searcher.asp?sType=pronsubmit=returncheckPR()>
请输入域名:提交/>
不要带
</form>
</div>
<%
IF(sType=prANDdomainName<>)THEN
PostStr=
getContent=GetURL(
getContent=RegExpText(getContent,在满分10分评价中获得<fontcolor=#FB5E3C>((.\n)*?)</font>分)
getContent=ReplaceKey(getContent,在满分10分评价中获得<fontcolor=#FB5E3C></font>分)
DimArrayPr
ArrayPr=Split(getContent,,)
Response.Write(<UL>)
Response.Write(<li><ahref=&domainName&的GooglePageRank值:<fontcolor=#FF0000><strong>&ArrayPr(0)&</strong></font></li>)
Response.Write(<li><ahref=的GooglePageRank值:<fontcolor=#FF0000><strong>&ArrayPr(1)&</strong></font>)
Response.Write(</UL>)
ENDIF
%>
</div>
</fieldset>
<fieldset>
<legend><strong>地区<->区号查询</strong></legend>
<div>
<divstyle=padding-left:23px;margin-bottom:8px;>
<%
DimzoneName
zoneName=Trim(Request.Form(zoneName))
%>
<formname=Zone2NumberFormmethod=postaction=searcher.asp?sType=zone2numberonsubmit=returncheckZone2NumberForm()>
地区<strong>→</strong>区号:<inputtype=textname=zoneNamevalue=<%=zoneName%>onfocus=select()/><inputtype=submitvalue=提交/>
</form>
</div>
<%
IF(sType=zone2numberANDzoneName<>)THEN
DimgetNumber,ArrayNumber
PostStr=area=&escape(zoneName)&&action=area2zone
getContent=GetURL(
getNumber=RegExpText(getContent,<TR><TDclass=tdc2>◎((.\n)*?)</TD>)
Response.Write(<UL>)
IF(getNumber=)THEN
Response.Write(<li><strong><fontcolor=#FF0000>没有搜索到记录</font></strong></li>)
ELSE
ArrayNumber=split(getNumber,,)
IF(isArray(ArrayNumber))THEN
Fori=0TOUBOUND(ArrayNumber)-1
Response.Write(<li><strong><fontcolor=#008000>&Replace(ArrayNumber(i),,,)&</font></strong></li>)
Next
ELSE
Response.Write(<li><strong><fontcolor=#008000>&Replace(getNumber,,,)&</font></strong></li>)
ENDIF
ENDIF
Response.Write(</UL>)
ENDIF
DimzoneNumber
zoneNumber=Trim(Request.Form(zoneNumber))
%>
<divstyle=padding-left:23px;margin-bottom:8px;>
<formname=Number2ZoneFormmethod=postaction=searcher.asp?sType=number2zoneonsubmit=returncheckNumber2ZoneForm()>
区号<strong>→</strong>地区:<inputtype=textname=zoneNumbervalue=<%=zoneNumber%>onfocus=select()/><inputtype=submitvalue=提交/>
</form>
</div>
<%
IF(sType=number2zoneANDzoneNumber<>)THEN
DimgetZone,ArrayZone
PostStr=action=zone2area&zone=&zoneNumber
getContent=GetURL(
getZone=RegExpText(getContent,<TR><TDclass=tdc2>◎((.\n)*?)</TD>)
Response.Write(<UL>)
IF(getZone=)THEN
Response.Write(<li><strong><fontcolor=#FF0000>没有搜索到记录</font></strong></li>)
ELSE
ArrayZone=split(getZone,,)
IF(isArray(ArrayZone))THEN
Fori=0TOUBOUND(ArrayZone)-1
Response.Write(<li><strong><fontcolor=#008000>&Replace(ArrayZone(i),,,)&</font></strong></li>)
Next
ELSE
Response.Write(<li><strong><fontcolor=#008000>&Replace(getZone,,,)&</font></strong></li>)
ENDIF
ENDIF
Response.Write(</UL>)
ENDIF
%>
</div>
</fieldset>
<fieldset>
<legend><strong>IP地理位置查询</strong></legend>
<div>
<divstyle=padding-left:23px;margin-bottom:8px;>
<formname=ipFormmethod=postaction=searcher.asp?sType=iponsubmit=returncheckIPForm()>
待查询的IP地址:<inputtype=textname=ipAddressvalue=<%=ipAddress%>/><inputtype=submitvalue=提交/>
</form>
</div>
</div>
</fieldset>
<fieldset>
<legend><strong>身份证号码查询</strong></legend>
<div>
<%
DimidentityNumber
identityNumber=Trim(Request.Form(identityNumber))
%>
<divstyle=padding-left:23px;margin-bottom:8px;>
<formname=identityFormmethod=postaction=searcher.asp?sType=identityonsubmit=returncheckIdentityForm()>
15或18位身份证号:<inputtype=textname=identityNumbervalue=<%=identityNumber%>/><inputtype=submitvalue=提交/>
</form>
</div>
<%
IF(sType=identityANDidentityNumber<>)THEN
DimArrayIDCardInfo
PostStr=action=idcard&userid=&identityNumber
getContent=GetURL(
getContent=RegExpText(getContent,:</font>((.\n)*?)<BR>)
Response.Write(<UL>)
IF(getContent=)THEN
Response.Write(<li>身份证号码错误或没有查询到相关数据</li>)
ELSE
ArrayIDCardInfo=split(getContent,,)
Response.Write(<li><strong>性别:</strong><fontcolor=#008000><strong>&Replace(ArrayIDCardInfo(0),,,)&</strong></font></li>)
Response.Write(<li><strong>出生日期:</strong><fontcolor=#008000><strong>&Replace(ArrayIDCardInfo(1),,,)&</strong></font></li>)
Response.Write(<li><strong>发证地区:</strong><fontcolor=#008000><strong>&Replace(ArrayIDCardInfo(2),,,)&</strong></font></li>)
ENDIF
Response.Write(</UL>)
ENDIF
%>
<divstyle=padding-left:23px;margin-bottom:8px;>
<formname=identityUpFormmethod=postaction=searcher.asp?sType=upIdentityonsubmit=returncheckIdentityUpForm()>
15位号码升至18位:<inputtype=textname=identityNumbervalue=<%=identityNumber%>/><inputtype=submitvalue=提交/>
</form>
</div>
<%
IF(sType=upIdentityANDidentityNumber<>)THEN
PostStr=action=upto18&userid=&identityNumber
getContent=GetURL(
getContent=RegExpText(getContent,升位后号码:((.\n)*?)</TD>)
Response.Write(<UL>)
IF(getContent=)THEN
Response.Write(<li>身份证号码错误或没有查询到相关数据</li>)
ELSE
Response.Write(<li><strong>升位(18位)后号码是:</strong><fontcolor=#008000><strong>&Replace(getContent,,,)&</strong></font></li>)
ENDIF
Response.Write(</UL>)
ENDIF
%>
</div>
</fieldset>
<divstyle=padding:15px;text-align:center;>
DESIGNEDBY<ahref=goaler
</div>
</body>
</html>
<%
FunctionByteToStr(vIn)
DimstrReturn,i,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
strReturn=
Fori=1ToLenB(vIn)
ThisCharCode=AscB(MidB(vIn,i,1))
IfThisCharCode<&H80Then
strReturn=strReturn&Chr(ThisCharCode)
Else
NextCharCode=AscB(MidB(vIn,i+1,1))
strReturn=strReturn&Chr(CLng(ThisCharCode)*&H100+CInt(NextCharCode))
i=i+1
EndIf
Next
ByteToStr=strReturn
EndFunction
FunctionGetURL(url,PostStr)
SetRetrieval=Server.CreateObject(Microsoft.XMLHTTP)
WithRetrieval
.OpenPOST,url,false,,
.setRequestHeaderContent-Type,application/x-
.Send(PostStr)
GetURL=.ResponseBody
EndWith
SetRetrieval=Nothing
GetURL=ByteToStr(GetURL)
EndFunction
FunctionRegExpText(strng,regStr)
DimregEx,Match,Matches,RetStr
SetregEx=NewRegExp
regEx.Pattern=regStr
regEx.IgnoreCase=True
regEx.Global=True
SetMatches=regEx.Execute(strng)
ForEachMatchinMatches
RetStr=RetStr®Ex.Replace(Match.Value,$1)&,
Next
RegExpText=RetStr
setregEx=nothing
EndFunction
%>