📄 down.asp
字号:
<!--#include file="Conn.asp"-->
<!--#include file=inc.asp-->
<%
Dim Rs,Sql,id
if request.QueryString("action")="down" then
dim fileurl
If Session("UserName")="" OR Session("UserId")="" Then
Response.Write("<script language=JavaScript>alert('您还没有登陆,只有登陆了才能下载!');document.location.href='index.asp';</script>")
Response.End
End if
id=Trim(Request.QueryString("id"))
if id="" Then
Response.write"参数丢失!"
Elseif not isnumeric(id) Then
response.Write("参数类型错误!")
else
Sql="Select * From Files where id="&clng(id)
set Rs=server.CreateObject("adodb.recordset")
If Not IsObject(Conn) Then ConnectionDatabase()
Rs.open sql,conn,1,3
if not rs.eof then
Rs("FileDowns")=Rs("FileDowns")+1
Rs.update
fileurl=Rs("FileUrl")
rs.close
set rs=nothing
CloseDatabase()
response.redirect "UploadFile/"&fileurl
else
rs.close
set rs=nothing
CloseDatabase()
response.write("文件不存在!")
end if
end if
response.End
end if
%>
<%Call Top("课件下载","down.asp")%>
<TABLE style="BORDER-RIGHT: #c0c0c0 1px solid; BORDER-LEFT: #c0c0c0 1px solid"
cellSpacing=0 cellPadding=0 width=778 align=center bgColor=#f7f7f7 border=0>
<TBODY>
<TR>
<TD vAlign=top width=220>
<TABLE cellSpacing=0 cellPadding=0 width="100%" align=center border=0>
<TBODY>
<TR>
<TD
background=images/side_bg_r1_c1.gif
height=34>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD width=10></TD>
<TD width=20><IMG height=14
src="images/ico_015.gif"
width=13 border=0></TD>
<TD width=100>用户登陆</TD>
<TD width=85></TD>
<TD width=5></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD
background=images/side_bg_r2_c1.gif>
<TABLE cellSpacing=0 cellPadding=0 width=200 align=center
border=0><TBODY>
<TR>
<TD align="center"><%If Session("UserName")="" OR Session("UserId")="" Then%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<form name="form1" method="post" action="Login.asp">
<tr>
<td width="34%" align="right">用户ID:</td>
<td width="66%">
<input name="UserId" type="text" id="UserId" size="15" maxlength="20" style="height:20px;width:120px"> </td>
</tr>
<tr>
<td align="right">密 码:</td>
<td>
<input name="UserPwd" type="password" id="UserPwd" size="15" maxlength="20" style="height:20px;width:120px"> </td>
</tr>
<tr>
<td height="3" colspan="2"></td>
</tr>
<tr>
<td><input name="action" type="hidden" id="action" value="login" /></td>
<td>
<input name="Login" type="submit" id="Login" value="登陆">
<input name="Reg" type="button" id="Reg" value="注册" onClick="location.href='Reg.asp'"> </td>
</tr>
</form>
</table>
<%Else%>
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="34%" align="right">欢 迎 您:</td>
<td width="66%"><%=Session("UserName")%></td>
</tr>
<tr>
<td align="right">登陆次数:</td>
<td><b><%=Session("UserLogins")%></b></td>
</tr>
<tr>
<td align="right">上传课件:</td>
<td><font color=red>
<%If Not IsObject(Conn) Then ConnectionDatabase()%>
<%=Conn.execute("Select UpFiles from Users Where UserId='"&Session("UserId")&"'")(0)%>
</font>个</td>
</tr>
<tr>
<td align="right">相关操作:</td>
<td><a href="UpLoad.asp"><font color=red>上传课件</font></a>
<a href="Edit.asp?Id=<%=Session("UserId")%>">修改资料</a>
<%If Session("UserAdmin") Then Response.Write"<a href=Admin.asp>添加用户</a>"%>
</td>
</tr>
<tr>
<td height="3" colspan="2"></td>
</tr>
<tr>
<td></td>
<td align="right"><input name="Logout" type="button" id="Logout" value="退出" onClick="location.href='Login.asp?action=logout'"> </td>
</tr>
</table>
<%End If%>
</TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD
background=images/side_bg_r3_c1.gif
height=4></TD></TR></TBODY></TABLE>
</TD>
<TD width=1 bgColor=#b4b4b4></TD>
<TD width=1 bgColor=#ffffff></TD>
<TD width=1></TD>
<TD vAlign=top width=553>
<TABLE cellSpacing=0 cellPadding=0 width=553 align=center border=0>
<TBODY>
<TR>
<TD width=2 rowSpan=2></TD>
<TD width=548>
<TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
<TBODY>
<TR>
<TD width=120
background=images/ad_title.gif
height=30>
<TABLE cellSpacing=0 cellPadding=0 width=120 border=0>
<TBODY>
<TR>
<TD colSpan=2 height=6></TD></TR>
<TR>
<TD width=10></TD>
<TD noWrap>▍课件信息</TD>
</TR>
<TR>
<TD colSpan=2 height=0></TD></TR></TBODY></TABLE></TD>
<TD align=middle width=428
background=images/ad_title_bg.gif
height=30></TD>
</TR></TBODY></TABLE></TD>
<TD width=3 rowSpan=2></TD></TR>
<TR>
<TD width=548>
<TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
<TBODY>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
<TBODY>
<TR>
<TD width=1 bgColor=#d4d4d4></TD>
<TD width=1 bgColor=#ffffff></TD>
<TD valign=top width=544 height=100>
<%
id=Trim(Request.QueryString("id"))
if id="" Then
Response.write"参数丢失!"
Elseif not isnumeric(id) Then
response.Write("参数类型错误!")
Else
Sql="Select * From Files where id="&clng(id)
set Rs=server.CreateObject("adodb.recordset")
If Not IsObject(Conn) Then ConnectionDatabase()
Rs.open sql,conn,1,1
If not Rs.Eof Then
response.write "<div align=center><b>"&HTMLEncode(Rs("FileTitle"))&"</b></div><hr>"
response.write HTMLEncode(Rs("FileAbout"))
response.write("<br><a href=down.asp?action=down&id="&id&"><img src=""images/download_btn.gif"" width=""75"" height=""32"" border=""0"" /></a>")
End If
Rs.close
Set Rs=nothing
End if
%>
</TD>
<TD width=1 bgColor=#ffffff></TD>
<TD width=1 bgColor=#d4d4d4></TD></TR></TBODY></TABLE></TD></TR>
<TR>
<TD>
<TABLE cellSpacing=0 cellPadding=0 width=548 border=0>
<TBODY>
<TR>
<TD width=1 bgColor=#d4d4d4></TD>
<TD bgColor=#ffffff height=1></TD>
<TD width=1 bgColor=#d4d4d4></TD></TR>
<TR>
<TD bgColor=#d4d4d4 colSpan=3
height=1></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE
style="BORDER-TOP-WIDTH: 1px; BORDER-RIGHT: #c0c0c0 1px solid; BORDER-BOTTOM-WIDTH: 1px; BORDER-LEFT: #c0c0c0 1px solid"
cellSpacing=0 cellPadding=0 width=778 align=center bgColor=#ffffff border=0>
<TBODY>
<TR>
<TD bgColor=#dbe2e8 height=1></TD></TR>
<TR>
<TD bgColor=#ffffff height=1></TD></TR>
<TR>
<TD bgColor=#c5cfd9 height=1></TD></TR>
<TR>
<TD bgColor=#dbe2e8 height=1></TD></TR></TBODY></TABLE>
<%Call Bottom()%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -