写的很简单,只是实现了功能
<%
Função formaturl(sim)
Se mid(sim,5,1)<>"" então
sim1 = esquerda (sim,3)
sim2 = certo(sim,cint(len(sim))-3)
formaturl = sim1 & "." & sim2
outro
formaturl = sim
terminar se
Função final
'取得远程网页二进制源代码
Função getBoy(url)
'em caso de erro, retome o próximo
Definir objXml = Server.CreateObject("Microsoft.XmlHttp")
com objXml
.open "get",url,falso,"",""
.enviar
getBoy = .responsebody
terminar com
getBoy = BytesToBstr(GetBoy,"GB2312")
Definir objXml = nada
função final
'处理二进制流代码
Função BytesToBstr(strBody,CodeBase)
dim objStream
definir 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.Fechar
definir objStream = nada
Função final
%>
未注册的域名如下
<%
'www.knowsky.com如果提交了查询
If Request.Form("sim") <> "" Então
sim = substituir(Request.Form("yes")," ","") '去除复选框字符串中的空格
sim = dividir(sim,",") '实例化一个数组sim,将用逗号隔开的sim数组赋值给sim新数组
Para i = 0 para 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("domínio")&"."&formaturl(yes(i))&"<br><br><br><br>" '列出未注册的域名
Terminar se
Próximo
resposta.Write "<p><p><p>已注册的域名如下:<br>"
Para i = 0 para 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("domínio")&"."&formaturl(yes(i))&"<br><br><br><br>" '列出已注册的域名
Terminar se
Próximo
Mais
%>
<nome do formulário="form1" método="post" action="">
<p>
<input name="domínio" type="text" id="domínio">
<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">
.líquido
<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">
.nome </p>
</form>
<%
Terminar se
%>