<!-- #include file="conn.asp" -->
<!-- #include file="cls_main.asp" -->
<!-- #include file="gg3.asp" -->
<div align="center">
<% dim obj
set obj = New DownloadVip
obj.AspInit()
set obj = nothing
class DownloadVip
Private ID, i, Mesky
Private Sub Class_Initialize()
Set Mesky = New Cls_Main
End Sub
Private Sub Class_Terminate()
Set Mesky = Nothing
End Sub
Public Sub AspInit()
If Request.QueryString("ID") = "" Then
Response.Write "非法操作!指定的参数不正确。"
Response.End
ElseIf IsNumeric(Request.QueryString("ID")) = False Then
Response.Write "非法操作!指定的参数不正确。"
Response.End
Else
ID = CLng(Request.QueryString("ID"))
End If
If Mesky.MemberUserName = "" Then
Response.Write "对不起,该软件属会员软件,请您<a href=""UserLogin.asp?url=" & Mesky.ScriptName & """>点击此处</a>登陆后下载或<a href=""UserReg.asp?url=" & Mesky.ScriptName & """>点击此处</a>免费注册成本站会员,全免费下载本站所有软件!"
Else
Set Rs = Nothing
Call UpdateHits(ID)
Call Mesky.LoadSetting
Response.Write showDownloadAddress(ID, Mesky.Setting(66))
end if
End Sub
Private Function FoundDownLog(ID)
Dim tRs
Set tRs = Mesky.Execute("select ID from Mesky_Down_Log where UserID="&Mesky.MemberUserID&" and ResourceID="&ID)
If tRs.eof and tRs.bof then
FoundDownLog = false
else
FoundDownLog = true
end If
Set tRs = Nothing
End Function
Private Sub UpdateHits(ResID)
Dim Rs
Set Rs = Mesky.Execute("select HitsTotal,DateMonth,DateWeek,DateToday from Mesky_Down_Resource where ID=" & ResID)
'更新软件下载次数
Mesky.Execute ("update Mesky_Down_Address set Hits=Hits+1 where ID=" & ID)
Mesky.Execute ("update Mesky_Down_Resource set HitsTotal=HitsTotal+1,HitsMonth=HitsMonth+1,HitsWeek=HitsWeek+1,HitsToday=HitsToday+1 where ID=" & ResID)
If DateDiff("H", Rs(3), Now) >= 24 Then Mesky.Execute ("update Mesky_Down_Resource set DateToday=" & SqlNowString & ",HitsToday=1 where ID=" & ResID)
If DateDiff("D", Rs(2), Now) >= 8 Then Mesky.Execute ("update Mesky_Down_Resource set DateWeek=" & SqlNowString & ",HitsWeek=1 where ID=" & ResID)
If DateDiff("D", Rs(1), Now) >= 31 Then Mesky.Execute ("update Mesky_Down_Resource set DateMonth=" & SqlNowString & ",HitsMonth=1 where ID=" & ResID)
Set Rs = Nothing
End Sub
'下载地址
Private Function showDownloadAddress(ID, brNum)
Dim sRs, aRs, s, arrDownloadName, arrDownloadURL, i
Set sRs = Mesky.Execute("select * from Mesky_Down_Address where ResourceID=" & ID & "")
If Not (sRs.EOF And sRs.BOF) Then
Do While Not sRs.EOF
If sRs("SiteID") > 0 Then '使用预定义
's = s & "<a href=""Download.asp"""
Set aRs = Mesky.Execute("select ID,DownloadName,DownloadURL,isLB from Mesky_Down_SiteSetting where ID = " & sRs("SiteID"))
arrDownloadName = Split(aRs(1), ",")
arrDownloadURL = Split(aRs(2), ",")
s = s & ("<img src=""images/d_download.gif"" align=""absmiddle"" border=""0""> <b>下载“" & sRs("Name") & "”</b><br>")
For i = 0 To UBound(arrDownloadName)
s = s & "·<a href=""" & arrDownloadURL(i) & sRs("URL") & """>" & arrDownloadName(i) & "</a> "
If ((i + 1) Mod brNum) = 0 Then s = s & "<br>"
Next
Set aRs = Nothing
Else '不使用预定义
s = s & "<img src=""images/d_download.gif"" align=""absmiddle"" border=""0""> <a href=""" & sRs("URL") & """>" & sRs("Name") & "</a><br>"
End If
sRs.MoveNext
Loop
End If
Set sRs = Nothing
showDownloadAddress = s
s = Null
End Function
End class
%><!-- #include file="gg4.asp" -->