asp下多个域名后缀同时查询的域名查询系统
程序员文章站
2023-11-12 14:41:28
写的很简单,只是实现了功能 <% function formaturl(yes) if mid(yes,5,1)<>""&...
写的很简单,只是实现了功能
<%
function formaturl(yes)
if mid(yes,5,1)<>"" then
yes1 = left(yes,3)
yes2 = right(yes,cint(len(yes))-3)
formaturl = yes1 & "." & yes2
else
formaturl=yes
end if
end function
'取得远程网页二进制源代码
function getboy(url)
'on error resume next
set objxml = server.createobject("microsoft.xmlhttp")
with objxml
.open "get",url,false,"",""
.send
getboy = .responsebody
end with
getboy = bytestobstr(getboy,"gb2312")
set objxml = nothing
end function
'处理二进制流代码
function bytestobstr(strbody,codebase)
dim objstream
set objstream = server.createobject("adodb.stream")
objstream.type = 1
objstream.mode =3
objstream.open
objstream.write strbody
objstream.position = 0
objstream.type = 2
objstream.charset = codebase
bytestobstr = objstream.readtext
objstream.close
set objstream = nothing
end function
%>
未注册的域名如下
<%
'www.knowsky.com如果提交了查询
if request.form("yes") <> "" then
yes = replace(request.form("yes")," ","") '去除复选框字符串中的空格
yes = split(yes,",") '实例化一个数组yes,将用逗号隔开的yes数组赋值给yes新数组
for i = 0 to ubound(yes) '遍历数组循环开始
url = "http://panda.www.net.cn/cgi-bin/check.cgi?domain="&request.form("domain")&"&ext="&yes(i)
wstr = getboy(url) '获取查询后的源代码
if instr(wstr,"未被注册的域名") <> 0 then '判断是否为已经注册的域名
response.write request.form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>" '列出未注册的域名
end if
next
response.write "<p><p><p>已注册的域名如下:<br>"
for i = 0 to ubound(yes) '遍历数组循环开始
url = "http://panda.www.net.cn/cgi-bin/check.cgi?domain="&request.form("domain")&"&ext="&yes(i)
wstr = getboy(url) '获取查询后的源代码
if instr(wstr,"已被注册的域名") <> 0 then '判断是否为已经注册的域名
response.write request.form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>" '列出已注册的域名
end if
next
else
%>
<form name="form1" method="post" action="">
<p>
<input name="domain" type="text" id="domain">
<input type="submit" name="submit" value="查询">
</p>
<p>
<input name="yes" type="checkbox" id="yes" value="com">
.com
<input name="yes" type="checkbox" id="yes" value="net">
.net
<input name="yes" type="checkbox" id="yes" value="org">
.org </p>
<p>
<input name="yes" type="checkbox" id="yes" value="comcn">
.com.cn
<input name="yes" type="checkbox" id="yes" value="netcn">
.net.cn
<input name="yes" type="checkbox" id="yes" value="orgcn">
org.cn
<input name="yes" type="checkbox" id="yes" value="govcn">
gov.cn </p>
<p>
<input name="yes" type="checkbox" id="yes" value="info">
.info
<input name="yes" type="checkbox" id="yes" value="biz">
.biz
<input name="yes" type="checkbox" id="yes" value="tv">
.tv
<input name="yes" type="checkbox" id="yes" value="cc">
.cc</p>
<p>
<input name="yes" type="checkbox" id="yes" value="cn">
.cn
<input name="yes" type="checkbox" id="yes" value="name">
.name </p>
</form>
<%
end if
%>
<%
function formaturl(yes)
if mid(yes,5,1)<>"" then
yes1 = left(yes,3)
yes2 = right(yes,cint(len(yes))-3)
formaturl = yes1 & "." & yes2
else
formaturl=yes
end if
end function
'取得远程网页二进制源代码
function getboy(url)
'on error resume next
set objxml = server.createobject("microsoft.xmlhttp")
with objxml
.open "get",url,false,"",""
.send
getboy = .responsebody
end with
getboy = bytestobstr(getboy,"gb2312")
set objxml = nothing
end function
'处理二进制流代码
function bytestobstr(strbody,codebase)
dim objstream
set objstream = server.createobject("adodb.stream")
objstream.type = 1
objstream.mode =3
objstream.open
objstream.write strbody
objstream.position = 0
objstream.type = 2
objstream.charset = codebase
bytestobstr = objstream.readtext
objstream.close
set objstream = nothing
end function
%>
未注册的域名如下
<%
'www.knowsky.com如果提交了查询
if request.form("yes") <> "" then
yes = replace(request.form("yes")," ","") '去除复选框字符串中的空格
yes = split(yes,",") '实例化一个数组yes,将用逗号隔开的yes数组赋值给yes新数组
for i = 0 to ubound(yes) '遍历数组循环开始
url = "http://panda.www.net.cn/cgi-bin/check.cgi?domain="&request.form("domain")&"&ext="&yes(i)
wstr = getboy(url) '获取查询后的源代码
if instr(wstr,"未被注册的域名") <> 0 then '判断是否为已经注册的域名
response.write request.form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>" '列出未注册的域名
end if
next
response.write "<p><p><p>已注册的域名如下:<br>"
for i = 0 to ubound(yes) '遍历数组循环开始
url = "http://panda.www.net.cn/cgi-bin/check.cgi?domain="&request.form("domain")&"&ext="&yes(i)
wstr = getboy(url) '获取查询后的源代码
if instr(wstr,"已被注册的域名") <> 0 then '判断是否为已经注册的域名
response.write request.form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>" '列出已注册的域名
end if
next
else
%>
<form name="form1" method="post" action="">
<p>
<input name="domain" type="text" id="domain">
<input type="submit" name="submit" value="查询">
</p>
<p>
<input name="yes" type="checkbox" id="yes" value="com">
.com
<input name="yes" type="checkbox" id="yes" value="net">
.net
<input name="yes" type="checkbox" id="yes" value="org">
.org </p>
<p>
<input name="yes" type="checkbox" id="yes" value="comcn">
.com.cn
<input name="yes" type="checkbox" id="yes" value="netcn">
.net.cn
<input name="yes" type="checkbox" id="yes" value="orgcn">
org.cn
<input name="yes" type="checkbox" id="yes" value="govcn">
gov.cn </p>
<p>
<input name="yes" type="checkbox" id="yes" value="info">
.info
<input name="yes" type="checkbox" id="yes" value="biz">
.biz
<input name="yes" type="checkbox" id="yes" value="tv">
.tv
<input name="yes" type="checkbox" id="yes" value="cc">
.cc</p>
<p>
<input name="yes" type="checkbox" id="yes" value="cn">
.cn
<input name="yes" type="checkbox" id="yes" value="name">
.name </p>
</form>
<%
end if
%>
上一篇: JAVA正则表达式校验qq号码的方法
下一篇: 草根站长前期赚钱很难