当前位置: 首页 > 图文教程 > 网络编程 > ASP > 多个域名后缀同时查询的域名查询系统

ASP
ASP XML操作类代码
asp读取xml实例代码
ASP读取XML实例 优酷专辑采集程序 雷锋版
asp自带的内存缓存 application
Cookies 欺骗漏洞的防范方法(vbs+js 实现)
asp清理缓存的代码
asp Driver和Provider两种连接字符串连接Access时的区别
asp 性能测试报告 学习asp朋友需要了解的东西
ASP实例代码:asp操作Excel类
ASP 高亮显示不区分大小写的关键字
ASP XMLDom在服务器端操作XML文件的主要方法和实现
IE8内部对渲染模型的判断流程
web开发人员必须知道的Unicode与字符集相关知识

ASP 中的 多个域名后缀同时查询的域名查询系统


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

 

写的很简单,只是实现了功能

<%
Function formaturl(yes)
 If mid(yes,5,1)<>"" then
 yes1 = left(yes,3)
 yes2 = right(yes,cint(len(yes))-3)
 formaturl = yes1 & "." & yes2
 else
 formaturl=yes
 end if
End Function
'取得远程网页二进制源代码
Function getBoy(url)
 'on error resume next
 Set objXml = Server.CreateObject("Microsoft.XmlHttp")
 with objXml
  .open "get",url,false,"",""
  .send
  getBoy = .responsebody
 end with
 getBoy = BytesToBstr(GetBoy,"GB2312")
 Set objXml = nothing
end function

'处理二进制流代码
Function BytesToBstr(strBody,CodeBase)
        dim objStream
        set objStream = Server.CreateObject("Adodb.Stream")
        objStream.Type = 1
        objStream.Mode =3
        objStream.Open
        objStream.Write strBody
        objStream.Position = 0
        objStream.Type = 2
        objStream.Charset = CodeBase
        BytesToBstr = objStream.ReadText
        objStream.Close
        set objStream = nothing
End Function
%>
未注册的域名如下
<%
'www.knowsky.com如果提交了查询
If Request.Form("yes") <> "" Then
 yes = replace(Request.Form("yes")," ","")  '去除复选框字符串中的空格
 yes = split(yes,",")  '实例化一个数组yes,将用逗号隔开的yes数组赋值给yes新数组
 
 For i = 0 to ubound(yes)   '遍历数组循环开始
  url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&Request.Form("domain")&"&ext="&yes(i)
  wstr = getBoy(url)  '获取查询后的源代码
  If instr(wstr,"未被注册的域名") <> 0 Then   '判断是否为已经注册的域名
   Response.Write Request.Form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>"  '列出未注册的域名
  End If 
 Next
 response.Write "<p><p><p>已注册的域名如下:<br>"
 For i = 0 to ubound(yes)   '遍历数组循环开始
  url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&Request.Form("domain")&"&ext="&yes(i)
  wstr = getBoy(url)  '获取查询后的源代码
  If instr(wstr,"已被注册的域名") <> 0 Then   '判断是否为已经注册的域名
   Response.Write Request.Form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>"  '列出已注册的域名
  End If 
 Next
 
Else

%>
<form name="form1" method="post" action="">
  <p>
    <input name="domain" type="text" id="domain">
    <input type="submit" name="Submit" value="查询">
  </p>
  <p>
    <input name="yes" type="checkbox" id="yes" value="com">
    .com
    <input name="yes" type="checkbox" id="yes" value="net">
.net
<input name="yes" type="checkbox" id="yes" value="org">
.org </p>
  <p>
    <input name="yes" type="checkbox" id="yes" value="comcn">
    .com.cn
    <input name="yes" type="checkbox" id="yes" value="netcn">
  .net.cn
  <input name="yes" type="checkbox" id="yes" value="orgcn">
org.cn
<input name="yes" type="checkbox" id="yes" value="govcn">
gov.cn </p>
  <p>
    <input name