首 页 网络编程
网页制作 图形图象 操作系统 冲浪宝典
软件教学 认证考试

网络安全 网络办公 行业资讯 评测对比
您当前位置:站长天空 -> 网络办公
利用asp查询某域名是否备案,并返回备案号-ASP教程,ASP技巧
作者:网友供稿 点击:76
推荐
西部数码-全国虚拟主机10强!20余项虚拟主机管理功能,全国领先!第6代双线路虚拟主机,南北访问畅通无阻!可在线rar解压,自动数据恢复设置虚拟目录等.免费赠送访问统计,企业邮局.Cn域名注册10元/年,自助建站480元起,免费试用7天,满意再付款!P4主机租用799元/月.月付免压金
站内搜索
文章页数:[1] 
利用asp查询某域名是否备案,并返回备案号
返回格式是:
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.z6688.com/
以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

文章页数:[1] 


放大字体显示 缩小字体显示 打印文章 推荐给朋友
热门文章
·JSP+JAVABEAN+SERVLET开发环境配置指南-JSP教程,Jsp/Servlet
·.net中webform和winform连接sql server 2000数据库的c#操作类-.NET教程,数据库应用
·C#中调用Windows API的要点-.NET教程,C#语言
·将.net组件注册为com组件-.NET教程,组件控件开发
·php上传、管理照片示例-PHP教程,PHP应用
·对通信电源维护管理工作的几点考虑——李晓明
·用c#写的贪吃蛇游戏,简简单单-.NET教程,C#语言
·java连接oracle,取io文件内容,子串替换-JSP教程,Java技巧及代码
·CASSINI源代码分析(1)-.NET教程,面向对象编程
·转换DataSet到普通xml的新法-.NET教程,数据库应用
最新文章
·office工具栏的配置管理与重置操作_办公软件教程
·word 2007表格简单计算和数字格式转换_word教程
·重命名office工具栏、菜单和菜单命令_办公软件教程
·移动或复制office按钮、菜单或菜单命令_办公软件教程
·word2007中快速插入固定内容的技巧_word教程
·修改word默认设置 让它用起来更顺手_word教程
·office文字快速录入技巧_办公软件教程
·编辑office菜单或按钮的键盘加速键_办公软件教程
·用excel 2007制作能互动的函数图像_excel教程
·将超链接分配给工具栏按钮或菜单命令_办公软件教程
相关主题
  • 利用asp.net ajax异步获取xml文档内容_ajax教程
  • 利用asp.net的内置功能抵御web攻击_asp.net技巧
  • 利用ASP发送和接收XML数据的处理方法-ASP教程,ASP技巧
  • 利用ASP.NET访问共享网络资源-.NET教程,Asp.Net开发
  • 利用ASP.NET 2.0创建自定义Web控件-.NET教程,Asp.Net开发
  • 西部数码虚拟主机

    友情链接
    CNNIC 西部数码
    万网 自助建站
    虚拟主机 asp空间
    域名注册 域名
    域名申请 主页空间
    论坛空间 网站空间
    国际域名 虚拟空间
    空间租用 DDOS防火墙
    成都主机托管 四川主机托管
    主机租用 服务器租用
    网站目录 自助建站
    虚拟主机 网址大全
    软件下载
    自助链接
    虚拟主机资讯 特价虚拟主机
    版权申明:本站文章均来自网络,如有侵权,请联系我们,我们收到后立即删除,谢谢!
    关于我们:站长天空:专业提供最新的站长资讯、在线教程、虚拟主机权威评测、虚拟主机性能对比、网站制作教程,开发教程,站长工具。包括网页制作教程、冲浪宝典、编程参考、操作系统、软件教学、行业动态等。
    特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有。
    发表评论 打印  刷新     关闭