域名查詢系統(tǒng)用到的類
代碼如下:
<%
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最新數(shù)據(jù)庫尚未發(fā)布。")
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
%>
相關(guān)文章
- ASP怎么談到應(yīng)用到類的?
- 檢測函數(shù) asp class
- 遭遇ASP類的事件設(shè)計
- ASP高亮類
- Object對象的一些的隱藏函數(shù)介紹
- 淺談ASP中的類
- 在VBScript中使用類
- ASP 類專題
- 代碼與頁面的分離
- ASP代碼的對象化
- 一個asp快速字符串連接類
- 一個簡單的asp數(shù)據(jù)庫操作類
- ASP類編寫詳細(xì)說明
- 實現(xiàn)支持邏輯搜索/單詞搜索/詞組搜索+支持OR/AND關(guān)鍵字的VBS CLASS!
- ASP類Class入門 推薦
- 創(chuàng)建一個ASP通用分頁類
- 如何編寫一個ASP類
- 一個ACCESS數(shù)據(jù)庫訪問的類第1/3頁
- 分頁類,異常類
- ASP 類 Class入門