asp下多個網域名稱尾碼同時查詢的網域名稱查詢系統

來源:互聯網
上載者:User

寫的很簡單,只是實現了功能

<%
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="yes" type="checkbox" id="yes" value="info">
.info
<input name="yes" type="checkbox" id="yes" value="biz">
.biz
<input name="yes" type="checkbox" id="yes" value="tv">
.tv
<input name="yes" type="checkbox" id="yes" value="cc">
.cc</p>
<p>
<input name="yes" type="checkbox" id="yes" value="cn">
.cn
<input name="yes" type="checkbox" id="yes" value="name">
.name </p>
</form>
<%
End If
%>

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.