溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

使用XMLHTTP制作域名查詢系統(tǒng)的案例分析

發(fā)布時間:2020-08-25 11:41:44 來源:億速云 閱讀:360 作者:小新 欄目:編程語言

這篇文章給大家分享的是有關(guān)使用XMLHTTP制作域名查詢系統(tǒng)的案例分析的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考。一起跟隨小編過來看看吧。

如何使用XMLHTTP制作域名查詢系統(tǒng)的代碼案例

<%
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=" 
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="域名已經(jīng)被注冊"
  elseif instr(lcase(wstr),"未被注冊的域名")>0 then
  body="域名未被注冊"
  else
   body="網(wǎng)絡(luò)延遲,請重新查找"
  end if                                  
end if
%>
   
<table width="40%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#999999">
  <tr>
   <td height="26" bgcolor="efefef">域名查詢系統(tǒng):<% 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>

代碼我已經(jīng)在本地測試過了。正常通過。

感謝各位的閱讀!關(guān)于使用XMLHTTP制作域名查詢系統(tǒng)的案例分析就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識。如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

向AI問一下細節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI