鉴于大家对ASP十分关注,我们编辑小组在此为大家搜集整理了“域名查询系统用到的类”一文,供大家参考学习
复制代码 代码如下:
<%
Dim Domain
Set Domain = New Cls_DomainFunction
Class Cls_DomainFunction
Private vListURL
Private Thief_
Private vDomainArr, vDomainName
Private vLoopI
Private vDomainsName, vDomainMainBody
Private TLDCode
Private Rs, Sql
Private ExtraDataArr
Private WhoisArr, WhoisCreationDate, WhoisExpirationDate, WhoisORG, WhoisName, WhoisBaiduSite, WhoisBaiduBody, WhoisPageRank
Public SqlQueryLengthID, SqlQueryComposeTypeID, SqlQueryTLDID, SqlOrderByID
Private SqlQueryLength, SqlQueryComposeType, SqlQueryTLD, SqlOrderBy
Public Function GetDomainList(vListID)
Select Case vListID
Case 1 : vListURL = "http://www.cnnic.net.cn/download/registar_list/pendingDel.txt"
Case 2 : vListURL = "http://www.cnnic.net.cn/download/registar_list/future2todayDel.txt"
Case 3 : vListURL = "http://www.cnnic.net.cn/download/registar_list/future1todayDel.txt"
Case 4 : vListURL = "http://www.cnnic.net.cn/download/registar_list/1todayDel.txt"
Case 5 : vListURL = "http://www.cnnic.net.cn/download/registar_list/2todayDel.txt"
Case 6 : vListURL = "http://www.cnnic.net.cn/download/registar_list/3todayDel.txt"
Case Else : vListURL = "http://www.cnnic.net.cn/download/registar_list/future1todayDel.txt"
End Select
Set Thief_ = New Cls_Thief
Thief_.Source = vListURL
Thief_.Steal
vDomainArr = Split(Thief_.Value,
vbLf)
Set Thief_ = Nothing
If UBound(vDomainArr) < 2 Then Call Cmd.OutputJavaInfo("CNNIC最新数据库尚未发布。")
Call ConnDB()
For vLoopI = 0 To UBound(vDomainArr)
vDomainsName = LCase(vDomainArr(vLoopI))
If Instr(vDomainsName, ".") > 0 Then
vDomainMainBody = Split(vDomainsName, ".")(0)
Conn.Execute("INSERT INTO [CNDomainList](DomainName, Body, Length, ComposeType, TLD) VALUES(''" & vDomainsName & "'', ''" & vDomainMainBody & "'', " & Len(vDomainMainBody) & ", " & GetDomainComposeType(vDomainMainBody) & ", " & GetDomainLTD(vDomainsName) & ")")
End If
Next
Call DisconnDB()
Call CompactDataBase(vDatabasePath, False)
End Function
Public Function ClearUpDatabase()
Call ConnDB()
Conn.Execute("DELETE * FROM [CNDomainList]")
Call DisconnDB()
Call CompactDataBase(vDatabasePath, False)
End Function
Private Function GetDomainComposeType(DomainName)
If Cmd.IsAlpha(DomainName) Then
GetDomainComposeType=1
ElseIf Cmd.IsDigit(DomainName) Then
GetDomainComposeType=2
ElseIf Cmd.IsAlphaDigit(DomainName) Then
GetDomainComposeType=3
Else
GetDomainComposeType=4
End If
End Function
Private Function GetDomainLTD(DomainName)
If UBound(Split(DomainName, ".")) > 1 Then
Select Case Split(DomainName, ".")(1)
Ca