Multi-domain name suffix under ASP query Domain Name query system _ Application Skills
Source: Internet
Author: User
It's easy to write, it's just a function.
<%
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
' Get the remote page binary source code
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
' Process binary Stream code
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
%>
The unregistered domain name is as follows
<%
' Www.knowsky.com If a query is submitted
If Request.Form ("yes") <> "Then
Yes = replace (Request.Form ("yes"), "" "" ") ' remove spaces from a check box string
Yes = Split (yes, ",") instantiate an array yes, assign a Yes array separated by commas to Yes new array
For i = 0 To UBound (yes) ' traversal of the array loop begins
url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain=" &request.form ("Domain") & "&ext=" &yes (i)
wstr = Getboy (URL) ' Get the source code after the query
If InStr (WSTR, "unregistered domain name") <> 0 Then ' Determine if the domain name is already registered
Response.Write Request.Form ("Domain") & "." &formaturl (yes (i)) & "<br><br><br><br>" ' lists unregistered domain names
End If
Next
Response. Write "<p><p><p> registered domain name is:<br> as follows"
For i = 0 To UBound (yes) ' traversal of the array loop begins
url = "http://panda.www.net.cn/cgi-bin/Check.cgi?domain=" &request.form ("Domain") & "&ext=" &yes (i)
wstr = Getboy (URL) ' Get the source code after the query
If InStr (WSTR, "registered domain name") <> 0 Then ' Determine if the domain name is already registered
Response.Write Request.Form ("Domain") & "." &formaturl (yes (i)) & "<br><br><br><br>" ' lists registered domain names
End If
Next
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.