<!--#include file="../setting/conn.asp"--><!--#include file="../Inc/UploadCls.asp"-->
<%:Dim thisdir,topdir,FileType,fso,FsoFile,AllFileSize,totalPut,strTitle,DirFolder,DirFiles:Dim obj:TopDir=webdir:FileType=LCase(Trim(Request("FileType"))):ThisDir=Trim(Request.QueryString("ThisDir")):obj=Trim(Request.QueryString("obj"))
if ThisDir<>"" Then 
ThisDir=Replace(ThisDir & "/","//","/")
Else:ThisDir=TopDir
end if:Set Fso=Server.CreateObject(FsoObjName):Select Case SoonBiz.Ract:Case "del" : delfile:Case "Rname" : Response.end:Case "edit" : fileinfo :Case "save" : saveinfo:Case "upfile" : upfile:Case Else : Main:End Select:Set Fso=Nothing:SoonBiz.adfoot:Setallnothing:Sub Main():Set FsoFile=Fso.GetFolder(Server.MapPath(ThisDir)):Dim FolderNuns,FileNums:FolderNuns=FsoFile.SubFolders.count :FileNums=FsoFile.Files.count :totalPut=FolderNuns+FileNums :Dim j,k:j=0:SoonBiz.topplus="<style type=""text/css"">a{text-decoration:none;}</style>":SoonBiz.title="文件管理":SoonBiz.adhead:Response.Write "<br>":Response.Write "<table cellspacing=""1"" class=""tableborder1"">":Response.Write " <tr><th colspan=""2"">选择文件</th></tr>":Response.Write " <tr>":Response.Write " <td><a href=""admin_files.asp?act=Main&FileType="& FileType &"&ThisDir="& webdir &"&amp;obj="& obj &""" title=""返回到主目录""><font color=#ff0000>返回主目录</font></a></td>":Response.Write " <td><a href=""admin_files.asp?act=Main&FileType="& FileType &"&ThisDir="& GetUpDir &"&amp;obj="& obj &"""><font color=FF0000>↑上一目录</font></a></td>":Response.Write " </tr>":Response.Write " <tr>":Response.Write " <td>当前目录："& ThisDir &"&nbsp;&nbsp;&nbsp;&nbsp;文件夹：<font color=blue>"& FolderNuns &"</font>&nbsp;个，文件：<font color=blue>"& FileNums &"</font>&nbsp;个, 占用空间: "& GetSize(FsoFile.size,"b") &"</td>":Response.Write " <td align=""right"" width=""80""></td>":Response.Write " </tr>":Response.Write "</table>":Response.Write "<br>":Response.Write "<table cellspacing=""1"" class=""tableborder1"">":Response.Write " <tr>":Response.Write " <th >文件/文件夹名</td>":Response.Write " <th width=""80"">文件大小</td>":Response.Write " <th width=""120"">最后修改时间</td>":Response.Write " <th width=50>操作</th>":Response.Write " </tr>":For Each DirFolder in FsoFile.SubFolders:Response.write "<tr>":Response.Write " <td><img src=""images/fileicon/folder.gif"" border=0 width=""16"" height=""16"" align=""absmiddle"">&nbsp;<a href=""admin_files.asp?act=Main&FileType="& FileType &"&ThisDir="& ThisDir & DirFolder.name &"&amp;obj="& obj &""">"& DirFolder.name &"</a></td>":Response.Write " <td align=""center"" width=""80"">"& GetSize(DirFolder.size,"b") &"</td>":Response.Write " <td align=""center"" width=""120"">&nbsp;"& DirFolder.DateLastModified &"</td>":Response.Write " <td>&nbsp;</td>":Response.Write "</tr>":Next:For Each DirFiles in FsoFile.Files:Response.Write "<tr>"
If act="w" Then 
Response.Write " <td> <img src=""images/fileicon/"& GetFileIcon(DirFiles.name) &""" border=""0"" width=""16"" height=""16"" align=""absmiddle"" alt="""& DirFiles.type &""" >&nbsp;<a href=""?act=edit&filepath="& thisdir&DirFiles.name &""">"& DirFiles.name &"</a></td>"
Elseif len(obj)>0 Then
Response.Write " <td><a href=""javascript:fileurl('"& obj &"','"& ThisDir & DirFiles.name &"');"" class=""ahover""> <img src=""images/fileicon/"& GetFileIcon(DirFiles.name) &""" border=""0"" width=""16"" height=""16"" align=""absmiddle"" alt="""& DirFiles.type &""" >&nbsp;"& DirFiles.name &"<script type=""text/javascript"">hoverview("""& ThisDir&DirFiles.Name &""");</script></a></td>"
Else:Response.Write " <td><a href=""#"" class=""ahover""> <img src=""images/fileicon/"& GetFileIcon(DirFiles.name) &""" border=""0"" width=""16"" height=""16"" align=""absmiddle"" alt="""& DirFiles.type &""" >&nbsp;"& DirFiles.name &"<script type=""text/javascript"">hoverview("""& ThisDir&DirFiles.Name &""");</script></a></td>"
End If:Response.Write " <td align=""center"" width=""80"">"& GetSize(DirFiles.size,"b") &"</td>":Response.Write " <td align=""center"" width=""120"">"& DirFiles.DateLastModified &"</td>":Response.Write " <td align=center><a href=""?act=del&amp;filename="& ThisDir & DirFiles.name &""">删除</a></td>":Response.Write "</tr>":Next:Response.Write "</table>":Set FsoFile=Nothing:Response.Write "<p></p>":Response.Write "<form method=""post"" action=""?act=upfile&amp;filepath="& thisdir &""" enctype=""multipart/form-data"">":Response.Write "<input type=""file"" name=""file1"" size=""30"" /> <input type=""submit"" class=""uploadbutton"" id=""uploadbutton"" value=""上传"" />":Response.Write "</form>":End Sub:Function GetUpDir():Dim strDir,strDir2,i:strDir=""
If ThisDir="" then Exit Function':ansame"didand'that::::shoulditsince\howhimself:
strDir2=ThisDir:strDir2=Split(strDir2,"/"):for i=0 to Ubound(strDir2)-1
if i<Ubound(strDir2)-1 then strDir=strDir & strDir2(i) & "/"
next:GetUpDir=strDir:End Function:Function GetFileIcon(FileName):FileName=Split(FileName,"."):Select Case LCase(FileName(Ubound(FileName))):Case "asp":GetFileIcon="asp.gif":Case "aspx":GetFileIcon="asp.gif":Case "jsp":GetFileIcon="asp.gif":Case "html":GetFileIcon="html.gif":Case "shtml":GetFileIcon="html.gif":Case "htm":GetFileIcon="html.gif":Case "shtm":GetFileIcon="html.gif":Case "xml":GetFileIcon="xml.gif":Case "bmp":GetFileIcon="bmp.gif":Case "doc":GetFileIcon="doc.gif":Case "gif":GetFileIcon="gif.gif":Case "ico":GetFileIcon="ico.gif":Case "jpg":GetFileIcon="jpg.gif":Case "js":GetFileIcon="js.gif":Case "mdb":GetFileIcon="mdb.gif":Case "mp3":GetFileIcon="media.gif":Case "wma":GetFileIcon="media.gif":Case "mid":GetFileIcon="media.gif":Case "png":GetFileIcon="png.gif":Case "rar":GetFileIcon="rar.gif":Case "swf":GetFileIcon="swf.gif":Case "txt":GetFileIcon="txt.gif":Case "xls":GetFileIcon="xls.gif":Case "xlt":GetFileIcon="xlt.gif":Case "zip":GetFileIcon="zip.gif":Case "exe":GetFileIcon="exe.gif":Case "dll":GetFileIcon="dll.gif":Case Else:GetFileIcon="other.gif":End Select:FileName=Empty:End Function:Public Function GetSize(Byval size,Byval unit)
if isEmpty(size) or Not Isnumeric(size) then Exit Function
size=CheckUnit(size,unit)
if size>1024 then'::!.likecan^there$+then:"allstill:takeget:
size=(size/1024):getsize=formatnumber(size,2) & " MB"
else:getsize=size & " KB":Exit Function
end if
if size>1024 then
size=(size/1024):getsize=formatnumber(size,2) & " GB"
end if:End Function:Public Function CheckUnit(Byval size,Byval unit):Select Case Lcase(Unit):Case "b":CheckUnit=formatnumber(size/1024,2):Case "k":CheckUnit=size:Case "m":CheckUnit=(size*1024):Case "g":CheckUnit=(size*1024*1024):Case Else:CheckUnit=size:End Select:End Function:Sub fileinfo:SoonBiz.LoadTemplatesAdmin("admin_files"):Dim filepath,content:filepath=SoonBiz.RequestStr("","filepath","get","1",2,255,0,1):content=SoonBiz.LoadFile(filepath):ShowErr(""):HtmlStr=Template.html(1):HtmlStr=replace(HtmlStr,"{$action}","?act=save&filepath="&filepath):HtmlStr=Replace(HtmlStr,"{$content}",content):Response.Write HtmlStr:End Sub:Sub saveinfo():SoonBiz.MakeHtml Request.Form("content"),Trim(Request.QueryString("filepath")):SoonBiz.adsuccess("保存成功"):End Sub:Sub upfile():Dim xmlgroup,upset:Set xmlgroup=application(CacheName & "_group").documentElement.selectSingleNode("group[@id='" & SoonBiz.User_gid & "']")'canbetween:many:onlysuch`take::'^it:eachabout[each
If xmlgroup Is Nothing Then
ShowErr("您所在的用户组不存在,请重新登录")
Else:upset=xmlgroup.getAttribute("upset")&""
End If
If len(upset)=0 Then
upset="0|0|0|"'they:got]came:theseanotherbeen:beinghaveonlydo:[{_about
End If:upset=split(upset,"|"):fuyou=SoonBiz.uploadsetting:fuyou=Split(fuyou,"|||"):Set Upload=New UpFile_Cls:Upload.UploadType=fuyou(1) :Upload.PreviewType=999:Upload.UploadPath=Trim(Request.QueryString("filepath")) :Upload.InceptFileType=upset(3) :Upload.MaxSize=upset(2) :Upload.InceptMaxFile=1 :Upload.IsReName=0 :Upload.SaveUpFile
If Upload.ErrCodes<>0 Then
showerr(Upload.Description)
End If:Set Upload=Nothing:SoonBiz.ok:End Sub:Sub delfile():Dim filename:filename=Trim(Request.QueryString("filename")):SoonBiz.DelFile(filename):SoonBiz.ok:End Sub
%>