⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 user_uploadfile.asp

📁 源码源源码 源码 源码码源 码源 码源 码源 码
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="user_check.asp"-->
<!--#include file="inc/function.asp"-->
<%
dim ID
dim Action
action=trim(request("action"))
ID=trim(Request("ID"))
set rs=conn.execute("select uppath from myweb_const where id=1")
uppath=rs(0)
rs.close
%>



<html>
<head>
<title>木叶村免费个人主页http://www.x92.cn</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="木叶村网免费个人主页http://www.x92.cn">
<meta name="description" content="木叶村网免费个人主页http://www.x92.cn">
<link rel="stylesheet" href="admin/Admin_STYLE.CSS">


</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">

<%if request("action")="" then%>

<table border="0" width="100%"  cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border" height="49">
	<tr class="tdbg" >
		<td height="24" class="title" width="7%" align="center">
		<font color="#000000">ID</font></td>
		<td height="24" class="title" align="center" width="23%">
		<font color="#000000">文件名</font></td>
		<td height="24" class="title" align="center" width="21%">
		<font color="#000000">上传日期</font></td>
		<td height="24" class="title" align="center" width="12%">
		<font color="#000000">文件大小</font></td>
		<td height="24" class="title" align="center" width="28%">
		<font color="#000000"> 
              操作</font></td>
	</tr>
<%

If Len(Trim(Request("page")))=0 Then  '返回目标页码的判断
page=1 
Else 
page=CInt(Trim(Request("page"))) 
End If

set rs=Server.CreateObject("ADODB.RecordSet")
        sql="select id,title,date,size from [myweb_upfile] where userid="&session("userid")&" order by userid desc"
		
	rs.open sql,conn,1,1
	rs.PageSize=20
if not rs.eof then
  rs.AbsolutePage=page
    for k=1 to rs.PageSize 
%> 
	<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
		<td width="7%" align="center" ><%=rs(0)%></td>
		<td width="23%" align="center" ><%=rs(1)%> </td>
		<td align="center" width="21%" ><%=rs(2)%> </td>
		<td align="center" width="12%" ><font color=red><%=rs(3)%></font>kb</td>
		<td align="center" width="28%" >  
		<a target="_blank" href="<%=uppath%>/<%=rs(1)%>">查看</a>&nbsp;&nbsp;&nbsp; <a href="user_uploadfile.asp?action=del&id=<%=rs(0)%>&title=<%=rs(1)%>&size=<%=rs(3)%>" <%="onClick='return confirm(""确定要删除此文件吗(不可恢复)?"");'"%>>删除</a>
		 		 </td>
	</tr>
	<%
 rs.movenext
    if rs.EOF Then Exit For
    next
  end if
%>	<tr class="tdbg" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#F6FcF9'">
		<td align="center" colspan="5" ><%
  if page <>1 then
     Response.Write "<a href=user_uploadfile.asp&page=1>首页</a> "
  end if
  tmppage = page - 1 
  if tmppage <= 0 then 
     tmppage = 1 
  else
     Response.Write"<a href=user_uploadfile.asp&page="&tmppage&">上一页</a>"
  end if
  tmppage = page + 1 
  if tmppage >rs.PageCount then 
     tmppage = page
  else
     Response.Write " <a href=user_uploadfile.asp&page="&tmppage&">下一页</a> "
  end if 
  if Cstr(page) <> Cstr(rs.PageCount) and Cstr(rs.PageCount) <> 0 then
    Response.Write "<a href=user_uploadfile.asp&page="&rs.PageCount&">尾页</a>"
  end if
  if Cstr(rs.PageCount) <> 0 then
  Response.Write "每页显示<font color=red>20</font>个文件信息  第<font color='blue'>" & page & "/"&rs.PageCount&"</font>页"
  end if
  Response.Write "  共有<font color='blue'>"&rs.RecordCount&"</font>个文件信息"
 rs.close
%>   </td>
	</tr>
</table>
<%end if%>
<%if request("action")="del" then
title=trim(request("title"))
size=trim(request("size"))
conn.execute("delete * from myweb_upfile where userid="&session("userid")&" and ID=" & id)
set fso = Server.Createobject("Scripting.FileSystemObject") 
path = server.MapPath(uppath&"/"&title)
fso.DeleteFile(path)
set fso = nothing
conn.execute("update [myweb_user] set usesize=usesize-"&size&" where userid="&session("userid")&"")
response.redirect"user_uploadfile.asp"
end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -