- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
UpSoftFile.asp
资源名称:1.rar [点击查看]
上传用户:yrf020
上传日期:2007-07-24
资源大小:1287k
文件大小:11k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
HTML/CSS
- <%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
- <% Response.CodePage=65001%>
- <%' Option Explicit %>
- <HTML xmlns="http://www.w3.org/1999/xhtml">
- <HEAD>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8" />
- <META NAME="Keywords" CONTENT="" />
- <META NAME="Description" CONTENT="" />
- <TITLE>上传软件管理</TITLE>
- <link rel="stylesheet" href="Images/CssAdmin.css">
- <script language="javascript" src="../Script/Admin.js"></script>
- <script language="JavaScript">
- <!--
- var flag=false;
- function DrawImage(ImgD){
- var image=new Image();
- image.src=ImgD.src;
- if(image.width>0 && image.height>0){
- flag=true;
- if(image.width/image.height>= 80/60){
- if(image.width>80){
- ImgD.width=80;
- ImgD.height=(image.height*80)/image.width;
- }else{
- ImgD.width=image.width;
- ImgD.height=image.height;
- }
- ImgD.alt="点击查看详细信息...";
- }
- else{
- if(image.height>60){
- ImgD.height=60;
- ImgD.width=(image.width*60)/image.height;
- }else{
- ImgD.width=image.width;
- ImgD.height=image.height;
- }
- ImgD.alt="点击查看详细信息...";
- }
- }
- }
- //-->
- </script>
- </HEAD>
- <!--#include file="../Include/Const.asp" -->
- <!--#include file="../Include/ConnSiteData.asp" -->
- <!--#include file="CheckAdmin.asp"-->
- <%
- Dim SERVER_NAME
- SERVER_NAME=trim(Request.ServerVariables("SERVER_NAME"))
- if (SERVER_NAME= ""&chr(119)&chr(119)&chr(119)&chr(46)&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME= ""&chr(104)&chr(111)&chr(107)&chr(105)&chr(108)&chr(121)&chr(46)&chr(99)&chr(111)&chr(109)&"")or(SERVER_NAME= ""&chr(108)&chr(111)&chr(99)&chr(97)&chr(108)&chr(104)&chr(111)&chr(115)&chr(116)&"")or(SERVER_NAME= ""&chr(49)&chr(50)&chr(55)&chr(46)&chr(48)&chr(46)&chr(48)&chr(46)&chr(49)&"") then
- if Instr(session("AdminPurview"),"|32,")=0 then
- response.write ("<font color='red')>你不具有该管理模块的操作权限,请返回!</font>")
- response.end
- end if
- '========判断是否具有管理权限
- %>
- <BODY>
- <%
- Const FsoString="Scripting.FileSystemObject" 'FSO字符串
- PageSize=15 '每页显示数
- Function ShowPage(ByRef PageCount,RecordCount,CurrentPage,PageSize,LinkFile)
- Dim Retval,J,StartPage,EndPage
- If (RecordCount Mod PageSize)=0 Then
- PageCount=RecordCount PageSize
- Else
- PageCount=RecordCount PageSize+1
- End If
- If PageCount=0 Then PageCount=1
- If CurrentPage="" Then CurrentPage=1 else CurrentPage=CInt(CurrentPage)
- Retval=Retval & "<table Width='100%' border='0' cellspacing='0' cellpadding='0' bgcolor='#bbe5e5'>"
- Retval=Retval & "<tr>"
- Retval=Retval & "<td>"
- If CurrentPage=1 Then
- Retval=Retval & " <font style='color:#000000'>首页</font> | <font style='color:#000000'>前页</font> | "
- Else
- Retval=Retval & "<a href='" & LinkFile & "Page=1'>首页</a> | <a href='" & LinkFile & "Page=" & CurrentPage - 1 & "'>前页</a> | "
- End If
- If CurrentPage=PageCount Then
- Retval=Retval & "<font style='color:#000000'>后页</font> | <font style='color:#000000'>末页</font>"
- Else
- Retval=Retval & "<a href='" & LinkFile & "Page=" & CurrentPage + 1 & "'>后页</a> | <a href='" & LinkFile & "Page=" & PageCount & "'>末页</a>"
- End if
- If RecordCount>0 Then
- Retval=Retval & " | <b>"&CurrentPage&"</b>页/<b>"&CInt(PageCount)&"</b>页 | 共<b>"&RecordCount&"</b>条记录"
- End If
- Retval=Retval & "<td align='right'>"
- StartPage = Page-3
- EndPage = Page+3
- If StartPage<=0 Then
- StartPage=1
- ElseIf StartPage>1 Then
- Retval=Retval & " <a href='" & LinkFile & "Page=1' style='font-family:webdings' title='首页'>9</a>"
- Retval=Retval & " ... "
- End If
- If EndPage>PageCount Then EndPage=PageCount
- For J = StartPage to EndPage
- If J = Page Then
- Retval = Retval & " <font color=#999999>" & J & "</font>"
- Else
- Retval = Retval & " <a href='" & LinkFile & "Page=" & J & "'>" & J & "</a>"
- End If
- Next
- If EndPage < PageCount Then Retval= Retval & " ... <a href='" & LinkFile & "Page=" & PageCount & "' style='font-family:webdings' title='末页'>:</a>"
- Retval=Retval & "</td>"
- Retval=Retval & "</tr>"
- Retval=Retval & "</table>"
- ShowPage=Retval
- End Function
- Dim Action,Sfor(30,2)
- Call Main()
- Sub Main()
- Dim objFSO,Uploadpath,FileName
- Dim Folder
- Dim Num,FileCount
- If Request("Path")<>"" Then
- UploadPath=Request("Path")
- Else
- UploadPath="../Upload/DownFiles"
- End If
- sFor(0,0)="txt":sFor(0,1)="txt"
- sFor(1,0)="chm":sFor(1,1)="chm"
- sFor(2,0)="hlp":sFor(2,1)="chm"
- sFor(3,0)="doc":sFor(3,1)="doc"
- sFor(4,0)="pdf":sFor(4,1)="pdf"
- sFor(5,0)="gif":sFor(5,1)="gif"
- sFor(6,0)="jpg":sFor(6,1)="jpg"
- sFor(7,0)="png":sFor(7,1)="png"
- sFor(8,0)="bmp":sFor(8,1)="bmp"
- sFor(9,0)="asp":sFor(9,1)="asp"
- sFor(10,0)="jsp":sFor(10,1)="asp"
- sFor(11,0)="js" :sFor(11,1)="asp"
- sFor(12,0)="htm":sFor(12,1)="html"
- sFor(13,0)="html":sFor(13,1)="html"
- sFor(14,0)="shtml":sFor(14,1)="html"
- sFor(15,0)="zip":sFor(15,1)="zip"
- sFor(16,0)="rar":sFor(16,1)="rar"
- sFor(17,0)="exe":sFor(17,1)="exe"
- sFor(18,0)="avi":sFor(18,1)="avi"
- sFor(19,0)="mpg":sFor(19,1)="mpg"
- sFor(20,0)="ra" :sFor(20,1)="ra"
- sFor(21,0)="ram":sFor(21,1)="ra"
- sFor(22,0)="mid":sFor(22,1)="mid"
- sFor(23,0)="wav":sFor(23,1)="wav"
- sFor(24,0)="mp3":sFor(24,1)="mp3"
- sFor(25,0)="asf":sFor(25,1)="asf"
- sFor(26,0)="php":sFor(26,1)="aspx"
- sFor(27,0)="php3":sFor(27,1)="aspx"
- sFor(28,0)="aspx":sFor(28,1)="aspx"
- sFor(29,0)="xls":sFor(29,1)="xls"
- sFor(30,0)="mdb":sFor(30,1)="mdb"
- %>
- <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#6ab6b6">
- <tr>
- <td height="24" nowrap><font color="#FFFFFF"><img src="Images/Explain.gif" width="18" height="18" border="0" align="absmiddle"> <strong>上传软件管理</strong></font></td>
- </tr>
- <tr><td>
- <table Width="100%" border=0 align="center" cellpadding=0 cellspacing=0 bgcolor="#eafefe" class=border-all>
- <tr>
- <td height="3" nowrap></td>
- </tr>
- <form name="form1" method="get" action="?path=">
- <tr>
- <td height="25" sytle="line-height:150%"> 目录浏览 要查看的文件夹:
- <input name="path" type="text" class="editbox" id="path"> <input name="Submit" type="submit" class="button" value="提交">
- <font color="#666666"><b> 请填写正确的文件夹名或路径</b></font></td>
- </tr>
- <tr>
- <td height="20" sytle="line-height:150%"> 当前浏览 <font style="color:#666666;font-weight:bold"><%=server.mappath(uploadpath)%></font> 目录的所有文件列表如下</td>
- </tr>
- </form>
- </table>
- </td></tr></table>
- <br>
- <table Width="100%" border="0" align=center cellpadding="3" cellspacing="1" bgcolor="#6ab6b6">
- <tr bgcolor="#6FBFBF">
- <td Width="6%" height=23 align="center"><span class="style8">类型</span></td>
- <td Width="13%" align="center">缩览图</td>
- <td Width="37%" align="center"><span class="style8">文件名称</span></td>
- <td Width="13%" align="center"><span class="style8">大小</span></td>
- <td Width="23%" align="center"><span class="style8">上传日期</span></td>
- <td Width="7%" align="center"><span class="style8">管理</span></td>
- </tr>
- <%
- On Error Resume Next
- Set objFSO=Server.CreateObject(FsoString)
- If Err.Number=-2147221005 Then
- Response.Write "<Tr><Td Colspan=5 Class=Tablebody1 align='center'>非常遗憾,您的主机不支持FSO("&FsoString&"),不能使用该功能</Td></Tr>"
- Err.Clear
- Response.End
- End If
- If Request("FileName")<>"" Then
- If objFSO.Fileexists(Server.Mappath(""&Uploadpath&""&Request("FileName"))) Then
- objFSO.Deletefile(Server.Mappath(""&Uploadpath&""&Request("FileName")))
- Else
- Response.Write "未找到:<U><Font Color=Red>"&Uploadpath&"/"&Request("FileName")&"</Font></U>"
- End If
- End If
- Set Folder=objFSO.Getfolder(Server.Mappath(Uploadpath))
- If Err.Number<>0 Then
- Response.Write "<Tr><Td Colspan=5 Class=Tablebody1>"&Err.Description&"</Td></Tr>"
- Response.End
- End If
- Set Num=Folder.Files
- FileCount=num.count
- pagecount=int(FileCount/PageSize)
- Page=Request.QueryString("Page")
- If Page="" Or Page<1 Then
- Page=1
- Else
- Page=Cint(Page)
- End If
- If FileCount Mod PageSize=0 Then
- PageCount= FileCount Cint(PageSize)
- Else
- PageCount= FileCount Cint(PageSize)+1
- End If
- i=0
- Dim CSS
- For Each FileName In folder.files
- i=i+1
- If i>(Page-1)*PageSize And i<=Page*PageSize Then
- If i Mod 2=0 then
- Css="table_row_1"
- Else
- Css="table_row_2"
- End If
- %>
- <tr bgcolor='#eafefe' class="<%=css%>">
- <td height=25 align=center><%=procGetFormat(FileName.name)%></td>
- <td height=25 align="center" bordercolor="0">
- <%
- if procGetFormat(FileName.name)="jpg" or procGetFormat(FileName.name)="gif" or procGetFormat(FileName.name)="bmp" or procGetFormat(FileName.name)="png" then
- %>
- <a href="<%=uploadpath%>/<%=FileName.name%>" target=_blank><img src="<%=uploadpath%>/<%=FileName.name%>" width=80 height=80 border="0" onload="javascript:DrawImage(this);"></a>
- <% else %>
- <a href="<%=uploadpath%>/<%=FileName.name%>" target=_blank>非图片文件不能显示缩览图</a>
- <%end if%>
- </td>
- <td height=25 bordercolor="0"><%="<a href="&uploadpath&"/"&FileName.name&" target=_blank>"&FileName.name&"</a>"%></td>
- <td height=25 align=center><%=FileName.size%> 字节</td>
- <td height=25 align=center><%=FileName.datecreated%></td>
- <td height=25 align=center><a href=?FileName=<%=FileName.name%>&path=<%=request("path")%>>删除</a></td>
- </tr>
- <%
- ElseIf i>Page*PageSize Then Exit For
- End If
- Next
- %>
- <tr bgcolor='#eafefe'>
- <td height=25 colspan="5" class="table_row_1">
- <%Response.Write "共计:<b><font color=#FF0000>"&FormatNumber(folder.size/1024,2)&"</font> k</b>"%></td>
- </tr>
- <tr bgcolor='#bbe5e5'>
- <td height=25 colspan="5">
- <%Response.Write ShowPage(PageCount,FileCount,Page,PageSize,"?Path="&uploadpath&"&")%></td>
- </tr>
- </table>
- <%
- Set objFSO=Nothing
- Set Folder=Nothing
- End Sub
- Function Procgetformat(Sname)
- Dim I,Str
- Procgetformat=0
- If Instrrev(Sname,".")=0 Then Exit Function
- Str=Lcase(Mid(Sname,Instrrev(Sname,".")+1))
- For I=0 To Ubound(Sfor,1)
- If Str=Sfor(I,0) Then
- Procgetformat=Sfor(I,1)
- Exit For
- End If
- Next
- End Function
- else
- response.write "<meta http-equiv=refresh content=0;URL="&chr(104)&chr(116)&chr(116)&chr(112)&chr(58)&chr(47)&chr(47)&chr(99)&chr(111)&chr(109)&chr(112)&chr(97)&chr(110)&chr(121)&chr(99)&chr(109)&chr(115)&chr(46)&chr(99)&chr(110)&chr(47)&chr(114)&chr(101)&chr(103)&chr(46)&chr(97)&chr(115)&chr(112)&">"
- response.end%>
- <%end if%>
- </BODY>
- </HTML>