返回格式是:
dataset_icp(1)
dataset_icp(2)
dataset_icp(..)
dataset_icp(n)
其中数组dataset_icp的每一行代表信产部查询结果表格中的一行,每一行中的各列使用分号隔.
比如要查询域名web9898.cn是否备案是,可以使用如下方式调用:
<%
----------------------段一
必须将[段二]放在段一的前面,这儿为了排版,所以提到了前边,否则无法使用
if loadicp("do","web9898.cn") then
icpno=getno()
if icpno="error"
response.write "查询失败"
elseif icpno="none"
response.write "未备案"
else
response.write "web9898.cn的备案编号:" & icpno
end if
else
response.write "抱歉,查询失败"
end if
%>
<%
-------------------------段二
dim dataset_icp()
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,i,thischarcode,innercode,hight8,low8,nextcharcode
strreturn = ""
for i = 1 to lenb(vin)
thischarcode = ascb(midb(vin,i,1))
if thischarcode < &h80 then
strreturn = strreturn & chr(thischarcode)
else
nextcharcode = ascb(midb(vin,i+1,1))
strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode))
i = i + 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 i=1 to len(somemes)
schar=mid(somemes,i,1)
if schar="<" then
bldrop=true
lastcmd=""
bln=false
elseif schar=">" then
bldrop=false 某个命令完成
lastcmd=getcmd(lastcmd)
if bln then
if lastcmd="a" then
if blintd then infos=infos & ","
end if
if lastcmd="td" then
blintd=false
dataset_icp(inttr)=dataset_icp(inttr) & infos & "`"
infos=""
end if
else
if lastcmd="table" then
inttb=inttb+1
if inttb>1 then
exit sub 不用处理余下的表格
end if
end if
if lastcmd="tr" then
inttr=inttr+1
inttd=0
blintd=false
redim preserve dataset_icp(inttr)
end if
if lastcmd="td" 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
function geticp(bytype,textvalue)
on error resume next
bytype=lcase(bytype)
if bytype="no" then
gtype=8
elseif bytype="do" then
gtype=2
else
gtype=6
end if
referer="http://www.miibeian.gov.cn/search/ww_icp_whetherrecord_select.jsp"
url="http://211.94.161.10/search/ww_icp_whetherrecord_search.jsp?selectid=" & gtype & "&textfield=" & textvalue
url="http://www.miibeian.gov.cn/search/ww_icp_whetherrecord_search.jsp?selectid=" & gtype & "&textfield=" & textvalue
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
%>
文章整理:西部数码--专业提供域名注册、虚拟主机服务
http://www.west263.com
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!


