<%
'程序功能,自動到信産部網站核對一個域名的備案情況,如(rú書從)果備案成功,返回備案編号。
ICPCheckURL=1
Dim DataSet_ICP()
function GetsRoot(ByVal whichD土遠omain)
whichDomain=Lcase(whichD西服omain)
Exts=".bj.cn,.sh.c秒高n,.tj.cn,.cq.cn,.he.cn,.s老嗎x.cn,.nm.cn,.ln.cn,.jl.cn,.hl.cn,.js志議.cn,.zj.cn,.ah.cn,.fj.cn,.jx.cn,.sd.cn電銀,.ha.cn,.hb.cn,.hn.cn,.gd司可.cn,.gx.cn,.hi.cn,."
Exts=Exts&"sc.cn,.gz.cn,.yn.cn,.xz麗制.cn,.sn.cn,.gs.cn,.qh.cn,.nx.cn,.xj.cn呢喝,.tw.cn,.hk.cn,.mo.cn,"
Exts= Exts & ".ac.cn,.com.cn市火,.net.cn,.org.cn,.gov.些喝cn,.edu.cn,.com,.net,.org,.biz,.cn,.inf海微o,.tv,.cc,.tw,.name,.ws,.in,.hk,見錯.tw,.us,.au,.ac,.ca"
AllTop=split(Exts,",白村")
if len(whichDomain)>3 the你現n
for z=0 to Ubound(AllTo低分p)
extLen=len(AllT慢費op(z))
if ri道師ght(whichDomain,extLen)=AllTo慢地p(z) then
prefix=left(wh去科ichDomain,len(whichDomain雪笑)-extLen)
dotPo老如s=inStrRev(prefix,".")
草金if dotPos>0 then
 自美; whichDomain=mid(prefix,dotPos+1)用腦 & AllTop(z)
end if
exit f鄉厭or
end河她 if
next
end if
GetsRoot=which子現Domain
end function
function getCmd(strM歌校)
strM=lcase(strM)
if inStr(strM," ")>0 then
getCmd=left(他動strM,inStr(strM," ")-1)
else
getCmd=strM
end if
end function
Function bstr(vIn)
Dim strReturn,iii,ThisCharCod女自e,innerCode,Hight8,Low8,NextCh員遠arCode
strReturn = ""
For iii = 1 To LenB(vIn)
ThisCharCode 唱個= AscB(MidB(vIn,iii,1))
If ThisCharCode < &劇些H80 Then
strReturn = strRet腦鄉urn & Chr(ThisCharCode)
Else
NextCharCode = 月體AscB(MidB(vIn,iii+1,1))
strRetur南體n = strReturn & 場妹Chr(CLng(ThisCharCode)間老 * &H100 + CInt(話坐NextCharCode))
ii山間i = iii + 1
End If
Next
bstr = strReturn  們城;
End Function
Sub tinyFitler(someMes)
ReDim Preserve DataSet_I票水CP(0)
blDrop=true
blN=false
PreChar=""
PreCmd=""
blInTd=false
intTB=0
intTR=0
intTD=0
blInTd=false
infos=""
for iii=1 to len(someM家用es)
Schar=mid(someMes,iii,1)
if Schar="<" then
blDrop=tr關朋ue
lastCmd=""
blN=false
elseif Schar=">" then
blDrop=false動上 '某個命令完成
lastCmd=getCmd(lastCmd)
if blN then
if l票雜astCmd="a" then
if blI舞匠nTd then infos=infos &鄉道; ","
end i票大f
if la關如stCmd="td" then
&nb用明sp; blInTD=false
DataSet_I秒快CP(intTR)=DataSet_ICP(intTR) & in樂線fos & "`"
infos=視又""
e刀樹nd if
else
&nb不鄉sp;if lastCmd="table" then
intTB=i音數ntTB+1
&行光nbsp;if intTB>1 th白好en
&城畫nbsp; Exit Sub '玩現不(bù)用處理餘下的表格
&nb照為sp; end if北少
end if
if lastC計用md="tr" then
&nbs慢遠p; intTR=intTR+1
in東弟tTD=0
blInT討熱D=false
ReDim P放來reserve DataSet_ICP(intTR)車數
 問劇;end if
if lastCmd="t也開d" then
 場到; blInTD=true
 金線;intTD=intTD+1
件技end if
end if
elseif Schar="去章/" and PreChar="<" then
blN=true
else
if not 生中blDrop then
if那店 blInTD then infos=infos中房 & Schar
else
lastCmd=lastCmd站湖 & Schar
end if
end if
PreChar=Schar
next
end Sub
'程序設計:西部數碼(http://www.west263.com )專業提供虛拟主機、域名注冊
Function GetICP(ByType,te作書xtvalue)
on error resume next
if ByType="No" the美習n
Gtype=8
else
Gtype=2
end if
'---type=6根據url查詢(URL);type=2,根據域名查詢(DO歌筆),type=8,根據icp編号來查(No)
if ByType="URL" then
Gtype=6
end if
Referer="http://www.miibeian.gov.cn/Search/W那懂W_ICP_WhetherRecord_Select.jsp話黑";
if ICPCheckURL="1" t吧視hen
url="http://211.94.161.10/Se兒會arch/WW_ICP_WhetherRecord_S新兵earch.jsp?selectid="; & Gtype & "&textfield亮城=" & textvalue
elseif ICPCheckURL="2" then
url="http://www.miibeian.家用gov.cn/Search/WW_ICP_WhetherRecord_Sear現書ch.jsp?selectid="; & Gtype & "&textf媽火ield=" & textvalue
end if
Set Retrieval = Server.CreateObjec內些t("Microsoft.XMLHTTP")
With Retrieval
.Open "Post", url, false樹讀
.setRequestHeader "Referer土農",Referer
.Send
GetICP =.ResponseBod輛線y
End With
Set Retrieval = Nothing
GetICP=bstr(GetICP)
End Function
'如(rú)果要檢查,必須先LoadICP
Function LoadICP(BYWH線爸ICH,GIVE)
RetCode=GetICP(BYWHIC可了H,GIVE)
if isNull(RetC舞我ode) then
LoadICP=false
else
Call tinyFitler也好(RetCode)
LoadICP=true
end if
end Function
Function GetNo()
RRsets=Ubound(DataSet_ICP)
if RRsets=0 then
GetNo="ERROR"
end if
if RRsets=1 then事吧
GetNo="NON藍不E"
end if
if RRsets>1 then
GetNo=split(DataSet_ICP(2),分請"`")(3)
end if
end Function
ckbind="要檢查的域名.com"
If LoadICP("DO",ckb下筆ind) Then
IcpNO微短=GetNo()
If IcpNo="NONE" O高裡r IcpNo="ERROR" Then
if LoadICP(間輛"URL",ckbind) then
&nbs黃男p;IcpNO=GetNo()
e懂靜nd if
End If 'GetsRoot
If IcpNo="NONE到森" Or IcpNo="ERROR" Then
if的技 LoadICP("DO",GetsRoot(ckbind)) then生議
&nbs費計p;IcpNO=GetNo()
end if
End If
If IcpNo="NON事風E" Or IcpNo="ERROR" Then
if LoadICP("URL要很",GetsRoot(ckbind)) then
I坐學cpNO=GetNo()
&n身去bsp;end if
End If
if IcpNo="NO師票NE" or IcpNo="ERROR" 內錯then
respnose.write &nbs上綠p;"該域名還未備案成功!"
else
respnose.write &相劇nbsp;"該域名已經備案成功!備案編号是:"&IcpNO
end if
End If
%>
<%
'程序功能,自動到信産部網站核對一個域名的備案情況,如果備案成功,返回備案編号。
ICPCheckURL=1
Dim DataSet_ICP()
function GetsRoot(ByVal whichDomain)
whichDomain=Lcase(whichDomain)
Exts=".bj.cn,.sh.cn,.tj.cn,.cq.cn,.he.cn,.sx.cn,.nm.cn,.ln.cn,.jl.cn,.hl.cn,.js.cn,.zj.cn,.ah.cn,.fj.cn,.jx.cn,.sd.cn,.ha.cn,.hb.cn,.hn.cn,.gd.cn,.gx.cn,.hi.cn,."
Exts=Exts&"sc.cn,.gz.cn,.yn.cn,.xz.cn,.sn.cn,.gs.cn,.qh.cn,.nx.cn,.xj.cn,.tw.cn,.hk.cn,.mo.cn,"
Exts= Exts & ".ac.cn,.com.cn,.net.cn,.org.cn,.gov.cn,.edu.cn,.com,.net,.org,.biz,.cn,.info,.tv,.cc,.tw,.name,.ws,.in,.hk,.tw,.us,.au,.ac,.ca"
AllTop=split(Exts,",")
if len(whichDomain)>3 then
for z=0 to Ubound(AllTop)
關你 extLen=len(AllTop(z)白和)
if right(whichDomain化女,extLen)=AllTop(z) then
prefix=暗畫left(whichDomain,len(whichDomain)-ext銀熱Len)
dotPos=inStrRev(prefix,".")
那站
if dotPos>0 then
wh的得ichDomain=mid(prefix,dotPos+1影光) & AllTop(z)
end 跳相if
exit for
end 不藍if
next
end if
Gets街村Root=whichDomain
end function
風拿
function getCmd(str小年M)
strM=lcase(strM)
if雪相 inStr(strM," ")>0 then
g章商etCmd=left(strM,inStr(strM," ")-1)
玩外 else
getCmd=strM
end為一 if
end function
Function bs現科tr(vIn)
Dim strReturn,iii,ThisCharC上姐ode,innerCode,Hight8,Low8,NextChar吧機Code
strReturn = ""
For志好 iii = 1 To LenB(vIn)
ThisCharCode拿術 = AscB(MidB(vIn,iii,1))
If This銀說CharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,iii+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
iii = iii + 1
End If
Next
bstr = strReturn
End Function
Sub tinyFitler(someMes)
ReDim Preserve DataSet_ICP(0)
blDrop=true
blN=false
PreChar=""
PreCmd=""
blInTd=false
intTB=0
intTR=0
intTD=0
blInTd=false
infos=""
for iii=1 to len(someMes)
Schar=mid(someMes,iii,1)
if Schar="<" then
blDrop=true
lastCmd=""
blN=false
elseif Schar=">" then
blDrop=false 體可 '某個命令完成
lastCmd=get花計Cmd(lastCmd)
if bl知生N then
if lastCmd="a"資船 then
if blInTd then infos=infos話年 & ","
end if
if lastCm頻她d="td" then
blInTD=false
熱都 DataSet_ICP(intTR)=DataSe線購t_ICP(intTR) & infos & "`"
in音女fos=""
end if
else
裡著 if lastCmd="table" t也廠hen
intTB=intTB+1
山讀 if intTB>1 then 志刀
Exit Sub '不(bù)水快用處理餘下的表格
end if
近件 end if
if lastCmd="tr" th遠紙en
intTR=intTR+1
多刀 intTD=0
blInTD=false
樹但
ReDim Preserve 腦雜DataSet_ICP(intTR)
end if
身老 if lastCmd="td" then
呢內
blInTD=true
in跳的tTD=intTD+1
end if
end if綠他
elseif Schar="/" and Pre舊森Char="<" then
blN=true
else
if not blDrop then
if blInTD then infos=infos & Schar
else
lastCmd=lastCmd & Schar
end if
end if
PreChar=Schar
next
end Sub
'程序設計:西部數碼(http://www.west263.com )專業提供虛拟主機、域名注冊
Function GetICP(ByType,textValue)
on error resume next
if ByType="No" then
Gtype=8
else
Gtype=2
end if
'---type=6根據url查詢(URL);type=2,根據域名查詢(DO),type=8,根據icp編号來查(No)
if ByType="URL" then
Gtype=6
end if
Referer="http://www.miibeian.gov.cn/Search/WW_ICP_WhetherRecord_Select.jsp"
if ICPCheckURL="1" then
url="http://211.94.161.10/Search/WW_ICP_WhetherRecord_Search.jsp?selectid=" & Gtype & "&textfield=" & textValue
elseif ICPCheckURL="2" then
url="http://www.miibeian.gov.cn/Search/WW_ICP_WhetherRecord_Search.jsp?selectid=" & Gtype & "&textfield=" & textValue
end if
Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Post", url, false
.setRequestHeader "Referer",Referer
.Send
GetICP =.ResponseBody
End With
Set Retrieval = Nothing
GetICP=bstr(GetICP)
End Function
'如果要檢查,必須先LoadICP
Function LoadICP(BYWHICH,GIVE)
RetCode=GetICP(BYWHICH,GIVE)
if isNull(RetCode) then
LoadICP=false
else
Call tinyFitler(RetCode)
LoadICP=true
end if
end Function
Function GetNo()
RRsets=Ubound(DataSet_ICP)
if RRsets=0 then
GetNo="ERROR"
end if
if RRsets=1 then
GetNo="NONE"
end if
if RRsets>1 then
GetNo=split(DataSet_遠我ICP(2),"`")(3)
end麗友 if
end Function
中人
ckbind="要檢查的域名.com"
喝厭If LoadICP("DO",ckbind) Then
費著 IcpNO=GetNo()
If Icp錯國No="NONE" Or IcpNo="ERR匠他OR" Then
if Loa都議dICP("URL",ckbind) t事個hen
IcpNO=GetNo()
en媽河d if
End If 'GetsRoot
笑拿If IcpNo="NONE" Or Ic放費pNo="ERROR" Then
if LoadICP("DO器們",GetsRoot(ckbind)) then
Icp些輛NO=GetNo()
end if
End If
跳黑
If IcpNo="NONE" O很章r IcpNo="ERROR" Then
if LoadICP("線山URL",GetsRoot(ckbind)) then
Icp朋河NO=GetNo()
end 內我if
End If
制線 if IcpNo="NONE" or IcpNo=麗男"ERROR" then
respnose.write 人路 "該域名還未備案成功!"
else
resp腦暗nose.write "該域名已經備案成功!備明呢案編号是:"&IcpNO
end if
農內
End If
%>