导航:业界 | 认证 | 工具 | 图形 | 技术 | 系统 | 网络 | 办公 | 网页 | 文摘 | 动画
您当前的位置:diva8.com -> I T -> 技术 -> ASP学院 -> I T内容
栏目导航
· .Net专栏 · Script
· ASP学院 · PHP学院
· Web服务器 · CGI学院
· XML学院 · SQL学院
· JSP学院 · SMS学院
热门I T
· [组图] 音频后期处理Adobe ...
· [组图] Photoshop--照片处理...
· [组图] 廉颇老矣?IE7.0 Bet...
· [图文] DuDu下载加速器推出...
· [组图] 清晰还原!Photoshop...
· [组图] 用photoshop给图片祛...
· [组图] DuDu 下载加速器试用...
· [组图] 新春特别版:PPLIVE...
· [图文] 让查找更方便些 腾讯...
· [组图] 廉颇老矣?IE7.0 Bet...
相关I T
· [组图] EXCEL建立分期付款查...
· [图文] 在不支持FSO的服务器...
· 用CGI编写WEB查询系...
· 在PHP中使用XML
· 对XML数据使用XMLCo...
· Web设计中如何使用X...
· 在基于Mozilla的浏览...
· 使用XML实现BBS(主题...
· 使用XMLHTTP发送超长...
· [图文] Web设计中如何使用X...
使用XMLHTTP制作域名查询系统
作者:admin  来源:齐昌网络  发布时间:2004-10-20 15:32:43  发布人:qichang

减小字体 增大字体


<%
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



[] [返回上一页] [打 印] [收 藏]
∷相关I T评论∷    (评论内容只代表网友观点,与本站立场无关!) [更多评论...]
关于本站 - 网站帮助 - 广告合作 - 下载声明 - 友情连接 - 网站地图 - 在线人数:
diva8.com Copyright © 2001-2006 diva8.com All Rights Reserved .粤ICP备05014750号