首 页 网站运营 网络编程 网页制作 图象媒体 数据库 建站资源 网管专区 下载专区 最新资讯
IT学堂|红色黑客联盟
设为首页
加入收藏
联系站长
您所在的位置:首页>网络编程>ASP>文章内容
使用XMLHTTP制作域名查询系统
来源: 作者: 发布时间:2007-04-12

<%
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://panda.www.net.cn/cgi-bin/Whois.cgi?domain="&request("domain")&"&"&request("root")&"=yes&work=whois&referer=http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&request("domain")


url="http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&request("domain")&"&ext="&request("root")
wstr=getHTTPPage(url)
'www.knowsky.com
'response.write Instr (wstr,"可以注册")  
  if instr(lcase(wstr),"已被注册的域名")>0 then
     body="域名已经被注册"
  elseif instr(lcase(wstr),"未被注册的域名")>0 then
  body="域名未被注册"
  else
     body="网络延迟,请重新查找"
  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="com.cn">.com.cn</option>
                  <option value="net.cn">.net.cn</option>
                  <option value="gov.cn">.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">&nbsp;</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">
          &nbsp;</div>
      </FORM></td>
  </tr>
</table>

代码我已经在本地测试过了。正常通过。
文章里面的用到的Microsoft.XMLHTTP组件。其用法请参见:http://www.knowsky.com/5190.html

转自:动态网制作指南 www.knowsky.com



[推荐] [返回顶部] [打印本页] [关闭窗口]
热点文章
·ASP如何获取客户端真实IP地址
·ASP实现可显示和隐藏的树型菜单
·用ASP动态生成JS的表单验证代码
·ASP:用Asp编程实现QQ的在线情况查询
·ASP:用ASP打造一个小型的网页BBS系统
·ASP:用ASP编程实现网络内容快速查找
·ASP:利用ASP把图片上传到数据库
·ASP无法更新ACCESS数据库解决方法
·如何对ASP.NET进行性能优化
·入门:防范SQL注入攻击的新办法
相关文章
·基于ASP的收发文管理系统的设计与实现
·用ASP制作张扬个性的调查系统
·XmlHttp异步获取网站数据的例子
·Delphi编写组件封装asp代码的基本步骤
·解密ASP源代码
·采用XMLHTTP编写一个天气预报的程序
·用ASPJPEG组件制作图片的缩略图和加水
·菜鸟详听ASP中也能解压缩rar文件
·各种存储过程使用指南
·纯ASP代码之公历转农历实现(含属相)
文章检索
Google
相关文章
·基于ASP的收发文管理系
·用ASP制作张扬个性的调
·XmlHttp异步获取网站数
·Delphi编写组件封装asp
·解密ASP源代码
·采用XMLHTTP编写一个天
·用ASPJPEG组件制作图片
·菜鸟详听ASP中也能解压
·各种存储过程使用指南
·纯ASP代码之公历转农历
·无组件的数据库的备份与
·用Asp+XmlHttp实现RssRe
·轻松实现将上传图片到数
·纯ASP代码之公历转农历
·用asp实现的代码批量修