_asp class class for Domain name query system

Source: Internet
Author: User
Copy Code code as follows:

<%
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 the latest database has not yet been published. ")

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)
Case "com"
Tldcode = 10011
Case "NET"
Tldcode = 10021
Case "Org"
Tldcode = 10051
Case "gov"
Tldcode = 10061
Case "AC"
Tldcode = 10071
Case Else
Tldcode = 10041
End Select
Else
Tldcode = 10001
End If
Getdomainltd = Tldcode
End Function

Private Sub CompactDatabase (DatabasePath, BOOLIS97)
On Error Resume Next
Dim Fso, Engine, strdatabasepath,jet_3x
strDatabasePath = Left (Databasepath,instrrev (DatabasePath, "\"))
Set Fso = CreateObject ("Scripting.FileSystemObject")
If err.number <> 0 Then
Err.Clear ()
Exit Sub
End If
If fso.fileexists (DatabasePath) Then
Fso.copyfile Databasepath,strdatabasepath & "Compactdbtemp.mdb"
Set Engine = CreateObject ("JRO. JetEngine ")
If BoolIs97 = "True" Then
Engine.compactdatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & strDatabasePath & " Compactdbtemp.mdb ", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & strDatabasePath & "Compactdbtemp1.mdb" _
& "Jet oledb:engine type=" & jet_3x
Else
Engine.compactdatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & strDatabasePath & " Compactdbtemp.mdb ", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data source=" & strDatabasePath & "Compactdbtemp1.mdb"
End If
Fso.copyfile strDatabasePath & "Compactdbtemp1.mdb", DatabasePath
Fso.deletefile (strDatabasePath & "Compactdbtemp.mdb")
Fso.deletefile (strDatabasePath & "Compactdbtemp1.mdb")
Set Fso = Nothing
Set Engine = Nothing
If err.number <> 0 Then
Err.Clear ()
Exit Sub
End If
End If
End Sub
End Class
%>

Contact Us

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.

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.