ASP域名查询怎么做
我的这个到底错在哪里了
1.htm文件内容
<form action="1.asp" method="get" name="domain">
<table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr class="ty01">
<td height="8" colspan="4"></td>
</tr>
<tr align="center" class="ty01">
<td>域名查询:www.</td>
<td><input name="domain" type="text" id="domain" size="15"></td>
<td><input name="submit" type="submit" id="submit" value="提交" src="images/chaxun.jpg" width="66" height="20"></td>
<td><input name="重置" type="reset" value="重置" width="66" height="20"></td>
</tr>
<tr align="center" class="ty01">
<td colspan="4"><table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr align="center" class="ty01">
<td align="center">
<input name="root" type="radio" value=".com"></td>
<td height="24" align="left">.com</td>
<td align="center"><input type="radio" name="root" value=".net"></td>
<td align="left">.net</td>
<td align="center"><input type="radio" name="root" value=".org"></td>
<td align="left">.org</td>
<td align="center"><input type="radio" name="root" value=".cn"></td>
<td align="left">.cn</td>
<td align="center"><input type="radio" name="root" value=".com.cn"></td>
<td align="left">.com.cn</td>
</tr>
<tr align="center" class="ty01">
<td align="center"><input type="radio" name="root" value=".cc"></td>
<td height="24" align="left">.cc</td>
<td align="center"><input type="radio" name="root" value=".info"></td>
<td align="left">.info</td>
<td align="center"><input type="radio" name="root" value=".biz"></td>
<td align="left">.biz</td>
<td align="center"><input type="radio" name="root" value=".net.cn"></td>
<td align="left">.net.cn</td>
<td align="center"><input type="radio" name="root" value=".org.cn"></td>
<td align="left">org.cn</td>
</tr>
</table></td>
</tr>
<tr align="center" class="ty01">
<td height="8" colspan="4"></td>
</tr>
</table>
</form>
1.asp文件内容
<%
function getpageurl(url)
dim Retrieval
Set Retrieval=Server.CreateObject("Microsoft.XMLHTTP")
Retrieval.open "Get",url,false,"",""
Retrieval.send
t=Retrieval.ResponseBody
getpageurl=BytesToBstr(t,"GB2312")
Set Retrieval = Nothing
end function
Function BytesToBstr(body,Cset)
dim objstream
set objstream = Server.CreateObject("adodb.stream")
objstream.Type = 1
objstream.Mode =3
objstream.Open
objstream.Write body
objstream.Position = 0
objstream.Type = 2
objstream.Charset = Cset
BytesToBstr = objstream.ReadText
objstream.Close
set objstream = nothing
End Function
If Request("domain")<>"" Then
url="http://www.onlinenic.com/cgi-bin/chinese/check_domain.cgi?domain=" &Request("domain")& "root=" &Request("root")& "x=16"&"y=11"
wstr= getpageurl(url)
if instr(lcase(wstr),"已被注册的域名")>0 then
body="域名已经被注册"
elseif instr(lcase(wstr),"未被注册的域名")>0 then
body="域名未被注册"
else
body="网络延迟,请重新查找"
end if
End If
%>