服务器之家:专注于服务器技术及软件下载分享
分类导航

PHP教程|ASP.NET教程|JAVA教程|ASP教程|

服务器之家 - 编程语言 - ASP教程 - asp下多个域名后缀同时查询的域名查询系统

asp下多个域名后缀同时查询的域名查询系统

2019-10-21 10:39asp技术网 ASP教程

asp下多个域名后缀同时查询的域名查询系统

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

  1. <%  
  2. Function formaturl(yes)  
  3.  If mid(yes,5,1)<>"" then  
  4.  yes1 = left(yes,3)  
  5.  yes2 = right(yes,cint(len(yes))-3)  
  6.  formaturl = yes1 & "." & yes2  
  7.  else  
  8.  formaturl=yes  
  9.  end if  
  10. End Function   
  11. '取得远程网页二进制源代码  
  12. Function getBoy(url)  
  13.  'on error resume next  
  14.  Set objXml = Server.CreateObject("Microsoft.XmlHttp")  
  15.  with objXml  
  16.   .open "get",url,false,"",""  
  17.   .send  
  18.   getBoy = .responsebody  
  19.  end with  
  20.  getBoy = BytesToBstr(GetBoy,"GB2312")  
  21.  Set objXml = nothing   
  22. end function  
  23.  
  24. '处理二进制流代码  
  25. Function BytesToBstr(strBody,CodeBase)  
  26.         dim objStream  
  27.         set objStream = Server.CreateObject("Adodb.Stream")  
  28.         objStream.Type = 1  
  29.         objStream.Mode =3  
  30.         objStream.Open  
  31.         objStream.Write strBody  
  32.         objStream.Position = 0  
  33.         objStream.Type = 2  
  34.         objStream.Charset = CodeBase  
  35.         BytesToBstr = objStream.ReadText   
  36.         objStream.Close  
  37.         set objStream = nothing  
  38. End Function  
  39. %>  
  40. 未注册的域名如下  
  41. <%  
  42. 'www.knowsky.com如果提交了查询  
  43. If Request.Form("yes") <> "" Then  
  44.  yes = replace(Request.Form("yes")," ","")  '去除复选框字符串中的空格  
  45.  yes = split(yes,",")  '实例化一个数组yes,将用逗号隔开的yes数组赋值给yes新数组  
  46.  
  47.  For i = 0 to ubound(yes)   '遍历数组循环开始  
  48.   url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&Request.Form("domain")&"&ext="&yes(i)  
  49.   wstr = getBoy(url)  '获取查询后的源代码  
  50.   If instr(wstr,"未被注册的域名") <> 0 Then   '判断是否为已经注册的域名  
  51.    Response.Write Request.Form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>"  '列出未注册的域名  
  52.   End If    
  53.  Next  
  54.  response.Write "<p><p><p>已注册的域名如下:<br>"  
  55.  For i = 0 to ubound(yes)   '遍历数组循环开始  
  56.   url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain="&Request.Form("domain")&"&ext="&yes(i)  
  57.   wstr = getBoy(url)  '获取查询后的源代码  
  58.   If instr(wstr,"已被注册的域名") <> 0 Then   '判断是否为已经注册的域名  
  59.    Response.Write Request.Form("domain")&"."&formaturl(yes(i))&"<br><br><br><br>"  '列出已注册的域名  
  60.   End If    
  61.  Next  
  62.  
  63. Else   
  64.  
  65. %>  
  66. <form name="form1" method="post" action="">  
  67.   <p>  
  68.     <input name="domain" type="text" id="domain">  
  69.     <input type="submit" name="Submit" value="查询">  
  70.   </p>  
  71.   <p>  
  72.     <input name="yes" type="checkbox" id="yes" value="com">   
  73.     .com  
  74.     <input name="yes" type="checkbox" id="yes" value="net">  
  75. .net   
  76. <input name="yes" type="checkbox" id="yes" value="org">   
  77. .org </p>  
  78.   <p>  
  79.     <input name="yes" type="checkbox" id="yes" value="comcn">   
  80.     .com.cn  
  81.     <input name="yes" type="checkbox" id="yes" value="netcn">   
  82.   .net.cn   
  83.   <input name="yes" type="checkbox" id="yes" value="orgcn">  
  84. org.cn   
  85. <input name="yes" type="checkbox" id="yes" value="govcn">   
  86. gov.cn </p>  
  87.   <p>  
  88.     <input name="yes" type="checkbox" id="yes" value="info">   
  89.     .info  
  90.     <input name="yes" type="checkbox" id="yes" value="biz">  
  91. .biz   
  92. <input name="yes" type="checkbox" id="yes" value="tv">   
  93. .tv   
  94. <input name="yes" type="checkbox" id="yes" value="cc">   
  95. .cc</p>  
  96.   <p>  
  97.     <input name="yes" type="checkbox" id="yes" value="cn">   
  98.     .cn   
  99.     <input name="yes" type="checkbox" id="yes" value="name">  
  100. .name  </p>  
  101. </form>  
  102. <%  
  103. End If  
  104. %>  

延伸 · 阅读

精彩推荐