- ·上一篇文章:用ASP实现对ORACLE数据库的操作
- ·下一篇文章:用ASP做的DNS LOOKUP程序
asp下多个域名后缀同时查询的域名查询系统
<
%
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 
&apos
取得远程网页二进制源代码
Function 
getBoy(url)
 
&apos
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
&apos
处理二进制流代码
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
%>
未注册的域名如下
<
%
&apos
www.knowsky.com如果提交了查询
If 
Request.Form("yes") 
<> 
"" 
Then
 
yes 
= 
replace(Request.Form("yes")," 
","") 
 
&apos
去除复选框字符串中的空格
 
yes 
= 
split(yes,",") 
 
&apos
实例化一个数组yes,将用逗号隔开的yes数组赋值给yes新数组
 
For 
i 
= 
0 
to 
ubound(yes) 
 
 
&apos
遍历数组循环开始
 
 
url 
= 
"http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&Request.Form("domain")&"&ext="&yes(i)
 
 
wstr 
= 
getBoy(url) 
 
&apos
获取查询后的源代码
 
 
If 
instr(wstr,"未被注册的域名") 
<> 
0 
Then 
 
 
&apos
判断是否为已经注册的域名
 
 
 
Response.Write 
Request.Form("domain")&"."&formaturl(yes(i))&"
" 
 
&apos
列出未注册的域名
 
 
End 
If 
 
 
Next
 
response.Write 
"
已注册的域名如下:
"
 
For 
i 
= 
0 
to 
ubound(yes) 
 
 
&apos
遍历数组循环开始
 
 
url 
= 
"http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&Request.Form("domain")&"&ext="&yes(i)
 
 
wstr 
= 
getBoy(url) 
 
&apos
获取查询后的源代码
 
 
If 
instr(wstr,"已被注册的域名") 
<> 
0 
Then 
 
 
&apos
判断是否为已经注册的域名
 
 
 
Response.Write 
Request.Form("domain")&"."&formaturl(yes(i))&"
" 
 
&apos
列出已注册的域名
 
 
End 
If 
 
 
Next
Else 
%>
method="post" 
action="">
 
 
 
 
 
 
name="domain" 
type="text" 
id="domain">
 
 
 
 
type="submit" 
name="Submit" 
value="查询">
 
 
 
 
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="com"> 
 
 
 
 
.com
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="net">
.net 
name="yes" 
type="checkbox" 
id="yes" 
value="org"> 
.org 
 
 
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="comcn"> 
 
 
 
 
.com.cn
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="netcn"> 
 
 
.net.cn 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="orgcn">
org.cn 
name="yes" 
type="checkbox" 
id="yes" 
value="govcn"> 
gov.cn 
 
 
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="info"> 
 
 
 
 
.info
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="biz">
.biz 
name="yes" 
type="checkbox" 
id="yes" 
value="tv"> 
.tv 
name="yes" 
type="checkbox" 
id="yes" 
value="cc"> 
.cc
 
 
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="cn"> 
 
 
 
 
.cn 
 
 
 
 
name="yes" 
type="checkbox" 
id="yes" 
value="name">
.name 
 
<
%
End 
If
%>
asp下多个域名后缀同时查询的域名查询系统