设为首页设为首页
 添加收藏添加收藏
 进入音乐版音 乐 版
  汉南在线网页设计Asp动态程序

使用XMLHTTP制作域名查询系统
作  者:匿名
关键字:ASP技术应用



<%
On Error Resume Next
Server.ScriptTimeOut=9999999
Function getHTTPPage(Path)
t = GetBody(Path)
getHTTPPage=BytesToBstr(t,"GB2312")
End function

Function GetBody(url)
on error resume next
Set Retrieval = CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Get", url, False, "", ""
.Send
GetBody = .ResponseBody
End With
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://pandawww.net.cn/cgi-bin/Whois.cgi?domain="&request("domain")&"&"&request("root")&"=yes&work=whois&referer=http://pandwww.net.cn/cgi-bin/Check.cgi?domain="&request("domain")
url="http://pandawww.net.cn/cgi-bin/Check.cgi?urlwww.net.cn&queryType=0&sign=2&domain1="&request("domain")&"&domain="&request("domain")&"&"&request("root")&"=yes&asia=&image24.x=32&image24.y=4"
'www.net.cn/cgi-bin/Check.cgi?queryType=0&>http://pandawww.net.cn/cgi-bin/Check.cgi?queryType=0&;domain1=dgfeichi&domain=dgfeichi&big5=n&sign=2&asia=&urlwww.net.cn&com=yes&image.x=29&image.y=10
wstr=getHTTPPage(url)
'response.write Instr (wstr,"可以注册")
if instr(lcase(wstr),"域名已被注册")>0 then
body="域名已被注册"
elseif instr(lcase(wstr),"恭喜,您查询的以下域名尚未注册")>0 then
body="尚未注册"
else
body="网络延迟,请重新查找"&url
end if
end if
%>

<table width="40%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
<tr>
<td height="26" bgcolor="efefef">域名查询系统:<% if request("domain")>"" then response.Write(request("domain")&"."&request("root")&body) end if%></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><form name="form1" method="post" action=""><table width="100%" border="0" cellspacing="1" cellpadding="1">
<tr>

<td height="36"> <div align="center">www.
<input type="text" name="domain">
<select name="root" id="select">
<option value="cn" selected>.cn</option>
<option value="com">.com</option>
<option value="net">.net</option>
<option value="org">.org</option>
<option value="comcn">.com.cn</option>
<option value="netcn">.net.cn</option>
<option value="govcn">.gov.cn</option>
</select>
</div></td>

</tr>
<tr>
<td height="35">
<div align="center">
<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" cellspacing="1" bgcolor="#999999">
<tr>
<td height="42" bgcolor="#FFFFFF">
<FORM name=search_form action='http://search.sohu.com/web' method=get target=_blank>
<div align="center">
<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;height=20">
 </div>
</FORM></td>
</tr>
</table>



来源:网络
阅读:4
日期:2008-11-14

【 双击滚屏 】 【 收藏 】 【 打印 】 【 关闭 】 【 字体: 】 
上一篇:采用XMLHTTP编写一个天气预报的程序
下一篇:利用XMLHTTP无刷新自动实时更新数据

  >> 相关文章
 
  ·采用XMLHTTP编写一个天气预报的程序
  ·ASP读取XML数据文件的方法
  ·xml常规应用之asp读写文档
  ·asp操作xml之如何生成xml数据
  ·利用XMLHTTP无刷新添加数据
  ·ASP提交表单保存数据到XML中
  ·ASP操作XML数据
  ·ASP操作XML类
授权使用:汉南在线 http://www.hzwz.net/(2008-2009)   
Copyright (c) 2002-2007 汉南在线. All Rights Reserved . 
经营许可证:陕ICP备05000109号 Powered by:汉南在线