📄 softdown.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="inc/const.asp"-->
<%
if request.QueryString("ID")="" then
CloseDatabase
response.write "不能连接或者没有指定下载软件"
response.end
end if
if System_Setting(0)=1 then
dim strReferer,isHttp,strHostName
isHttp=false
strReferer=Request.ServerVariables("HTTP_REFERER")
strHostName=split(System_Info(5),"|")
for iii = 0 to ubound(strHostName)
if instr(strReferer,trim(strHostName(iii)))>0 then isHttp=True
next
if isnull(strReferer) or isHttp=false then
Response.Write "下载链接来自其他网站,这是不允许的,<a href=""./"">请进入本站页面后再进行下载。</a>"
CloseDatabase
response.end
end if
end if
set rs=server.createobject("adodb.recordset")
sql="select * from SoftDown_SoftLink where ID="&Trim(Request.QueryString("ID"))
rs.open sql,conn,1,1
if not rs.eof then
Address=trim(rs("Address"))
SoftID=rs("SoftID")
TypeID=rs("TypeID")
Special=rs("Special")
UserClassID=rs("UserClass")
else
Address=System_info(1)
SoftID=""
end if
rs.close
if SoftID<>"" then
sql="select * from SoftDown_SoftInfo where SoftID="&SoftID
rs.open sql,conn,1,1
DayDate=trim(rs("DayDate"))
WeekDate=trim(rs("WeekDate"))
MonthDate=trim(rs("MonthDate"))
AllHits=trim(rs("AllHits"))
avgGrade=trim(rs("avgGrade"))
'更新软件下载次数
sql="update SoftDown_SoftLink set Hits=Hits+1 where Id=" & cstr(request.QueryString("ID"))
conn.execute sql
sql="update SoftDown_SoftInfo set AllHits=AllHits+1,DayHits=DayHits+1,WeekHits=WeekHits+1,MonthHits=Monthhits+1 where SoftId=" & SoftID
conn.execute sql
if datediff("H",DayDate,Now)>=24 then
sql="update SoftDown_SoftInfo set DayDate=date(),DayHits=1 where SoftId=" & SoftID
conn.execute sql
end if
if datediff("D",WeekDate,Now)>=7 then
sql="update SoftDown_SoftInfo set WeekDate=date(),WeekHits=1 where SoftId=" & SoftID
conn.execute sql
end if
if datediff("D",MonthDate,Now)>=31 then
sql="update SoftDown_SoftInfo set MonthDate=date(),MonthHits=1 where SoftId=" & SoftID
conn.execute sql
end if
rs.close
end if
'检查会员软件下载权限
if UserClassID>0 then
if isnull(cUserName) or cUserName="" then
set rs=nothing
CloseDatabase
response.write "Sorry!没有登录系统,不能下载会员软件。"
response.end
elseif cint(cUserClass)<cint(UserClassID) then
set rs=nothing
CloseDatabase
response.write "Sorry!你是“"&UserClass(cUserClass)&"”,下载此软件需要更高的级别。"
response.end
end if
end if
dim DownloadURL,splDownloadURL
'Response.Write(TypeID)
if TypeID>0 then
sql="select * from SoftDown_SoftLinkType where ID="&TypeID
rs.open sql,conn,1,1
splDownloadURL=split(rs("DownloadURL"),",")
if rs("isLB")=0 then
randomize timer
i=int(rnd*ubound(splDownloadURL))
DownloadURL=splDownloadURL(i)
else
DownloadURL=splDownloadURL(Trim(Request.QueryString("lbID")))
end if
rs.close
end if
set rs=nothing
CloseDatabase
'Response.Write(DownloadURL)
if left(address,1)<>"/" then
response.redirect(address)
else
response.redirect DownloadURL & address
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -