当前位置: 首页 > 图文教程 > 网络编程 > ASP > 使用XMLHTTP制作域名查询系统

ASP
使用组件搜索
检查sql字符串中是否有单引号,有则进行转化.
判断文章中文字符数量
转换html代码子程序
简单的检查输入email是否合法程序
检查来访IP是否合法的实际应用
如何使用asp创建dsn
如何用asp进行base64加密
在ASP+中使用Cookie
asp+ 如何跨站抓取页面
在Asp中不借助第三方组件抓取别的站点的页面
如何在网页中变化图象(速度无延迟)
利用OWC服务器端组件动态生成图表
实现聊天室在线人员无刷新所需要的javascript技术 - 1
实现聊天室在线人员无刷新所需要的javascript技术 - 2
实现聊天室在线人员无刷新所需要的javascript技术 - 3
精彩ASP-镜象站点速度测试
在JSP、ASP和PHP网站网页中使用XHTML
ADO如何善用RecordSet组件呢?
ADO如何新增修改刪除数据库的资料呢?

ASP 中的 使用XMLHTTP制作域名查询系统


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 52 ::
收藏到网摘: n/a

 

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