<%
Em caso de erro, retomar o próximo
Servidor.ScriptTimeOut=9999999
Função getHTTPPage(Caminho)
t = GetBody(Caminho)
getHTTPPage=BytesToBstr(t,"GB2312")
Função final
Função GetBody(url)
em caso de erro, retome a seguir
Definir recuperação = CreateObject("Microsoft.XMLHTTP")
Com recuperação
.Abra "Obter", url, Falso, "", ""
.Enviar
GetBody = .ResponseBody
Terminar com
Definir recuperação = nada
Função Final
Função BytesToBstr(body,Cset)
escurecer objstream
definir objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Modo =3
objstream.Open
objstream.Escrever corpo
objstream.Posição = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Fechar
definir objstream = nada
Função final
%>
<%
if request("domínio")<>"" then
'url=" http://panda.www.net.cn/cgi-bin/Whois.cgi?domain="&request("domínio")&"&"&request("root")&"=yes&work=whois&referer= http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&request("domínio ")
url=" http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&request("domínio")&"&ext="&request("root ")
wstr=getHTTPPage(url)
'www.knowsky.com
'response.write Instr (wstr,"可以注册")
if instr(lcase(wstr),"已被注册的域名")>0 então
body="域名已经被注册"
elseif instr(lcase(wstr),"未被注册的域名")>0 então
body="域名未被注册"
outro
body="网络延迟,请重新查找"
terminar se
terminar se
%>
<table width="40%" border="0" align="center" cellpadding="5" cellpacing="1" bgcolor="#999999">
<tr>
<td height="26" bgcolor="efefef">域名查询系统:<% if request("domain")>"" then response.Write(request("domain")&"."&request("root") &corpo) fim if%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><form name="form1" method="post" action=""><table width="100%" border="0" cellpacing="1" cellpadding="1">
<tr>
<td height="36"> <div align="center">www.
<input type="text" nome="domínio">
<select name="root" id="select">
<option value="cn" selecionado>.cn</option>
<option value="com">.com</option>
<option value="net">.net</option>
<option value="org">.org</option>
<option value="com.cn">.com.cn</option>
<option value="net.cn">.net.cn</option>
<option value="gov.cn">.gov.cn</option>
</selecionar>
</div></td>
</tr>
<tr>
<td altura="35">
<div alinhar="centro">
<input type="submit" name="Submit" value=" 查 询 ">
</div>
<div align="center"></div></td>
</tr>
</table></form></td>
</tr>
</table>
<p align="center"> </p>
<table width="40%" border="0" align="center" cellpadding="5" cellpacing="1" bgcolor="#999999">
<tr>
<td height="42" bgcolor="#FFFFFF">
<FORM name=search_form action='http://search.sohu.com/web' method=get target=_blank>
<div alinhar="centro">
<input type="hidden" name="pid" value="hljec">
<input name="query" type="text" style="font-size:14px;width:150" value="好域名">
<input type="submit" name="ss" value="查看" onclick=document.search_form.action='http://search.sohu.com/web' style="font-size:14px;width=40 ;altura=20">
</div>
</FORM></td>
</tr>
</table>
代码我已经在本地测试过了。正常通过。
文章里面的用到的Microsoft.XMLHTTP组件。其用法请参见: http://www.knowsky.com/5190.html