📄 domainclass.asp
字号:
<%
class domainclass
Private domain_type '域名类型
Private cnurl
Private url
Private domain '域名
Private d_exsit '是否存在
Private Sub Class_Initialize()
cnurl = "http://nm.cnnic.net.cn/cgi-bin/srdp_new.cgi?domain="
url = "http://www.onlinenic.com/cgi-bin/chinese/whois.cgi?domain="
d_exsit = 1
End Sub
Private Function bytes2BSTR(vIn)
Dim i, ThischrCode, NextchrCode
strReturn = ""
For i = 1 To LenB(vIn)
ThischrCode = AscB(MidB(vIn, i, 1))
If ThischrCode < &H80 Then
strReturn = strReturn & Chr(ThischrCode)
Else
NextchrCode = AscB(MidB(vIn, i + 1, 1))
strReturn = strReturn & Chr(CLng(ThischrCode) * &H100 + CInt(NextchrCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
Private Function getpage()
Dim pageurl
Dim temp
Set temp = Server.CreateObject("microsoft.xmlhttp")
If domain_type = "cn" Then
pageurl = cnurl & domain
Else
pageurl = url & domain
End If
With temp
.Open "GET", pageurl, False, "", ""
.Send
getpage = .Responsetext
getpage = bytes2BSTR(.Responsebody)
End With
Set temp = Nothing
End Function
Private Function dowith()
Dim lStrURL
Dim pagebefore
Dim pageafter
Dim tempcontent
Dim pagestart
Dim pageend
dim temps
pageafter = "<PRE>"
pagebefore = "</PRE>"
tempcontent = getpage
if d_exsit<>0 then
pagestart = InStr(1,tempcontent, pageafter,1)
If pagestart = 0 Then
dowith = "意外的错误2!"
d_exsit = 3
Exit Function
Else
pagestart = pagestart + Len(pageafter) + 1
pageend = InStr(pagestart, tempcontent, pagebefore,1)
If pageend = 0 Then
dowith = "意外的错误!"
d_exsit = 3
Exit Function
Else
pageend = pageend - pagestart '得到内容长度
tempcontent = Mid(tempcontent, pagestart, pageend)
End If
End If
'Set pageregexp = New RegExp
'pageregexp.Global = True
' pageregexp.Pattern = "<[^>]*>"
' tempcontent = pageregexp.Replace(tempcontent, "")
' Set pageregexp = Nothing
dowith ="<pre>" &tempcontent&"</pre>"
End If
End Function
Private Function dowithcn()
Dim pagebefore
Dim pageafter
Dim tempcontent
Dim pagestart
Dim pageend
pageafter = "<TABLE ALIGN="
pagebefore = "</TABLE>"
tempcontent = getpage
if d_exsit<>0 then
pagestart = InStr(tempcontent, pageafter)
If pagestart = 0 Then
dowithcn = "意外的错误1!"
d_exsit = 3
Exit Function
Else
pageend = InStr(pagestart, tempcontent, pagebefore)
If pageend = 0 Then
dowithcn = "意外的错误!"
d_exsit = 3
Exit Function
Else
pageend = pageend+8 - pagestart '得到内容长度
tempcontent = Mid(tempcontent, pagestart, pageend)
End If
End If
tempcontent = Replace(tempcontent, "http://www.cnnic.net.cn", "")
dowithcn = tempcontent
End If
End Function
Public Function result()
If domain_type = "cn" Then
result = dowithcn
Else
result = dowith
End If
End Function
Public Property Let get_domain_type(ByVal vData)
domain_type = vData
End Property
Public Property Let get_domain(ByVal vData)
domain = vData
End Property
Public Property get exsit()
dim tempcontent
tempcontent=getpage
temps="No match"
if domain_type = "cn" Then
If InStr(1,tempcontent, "在CNNIC的已注册域名库中没有找到这个条目。",1) <> 0 Then d_exsit = 0
Else
pagestart2=instr(1,tempcontent,temps,1)
If pagestart2<>0 Then d_exsit = 0
End If
exsit = d_exsit
End Property
end class
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -