<style type="text/css">
<!--
a {
font-size: 9pt;
color: #3300CC;
text-decoration: none;
}
body {
font-size: 9pt;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
line-height: 20px;
background-color: #EEEEEE;
}
td {
font-size: 9pt;
line-height: 20px;
}
.tx {
border-color:#000000;
border-left-width: 0px;
border-top-width: 0px;
border-right-width: 0px;
border-bottom-width: 1px;
font-size: 9pt;
background-color: #EEEEEE;
}
.tx1 {
font-size: 9pt;
border: 1px solid;
border-color:#000000;
color: #000000;
}
-->
</style>
<%
'版权声明:本代码仅供学习研究之用,本人不对因使用本程序而造成的任何后果负责。未经作者书面许可不得用于商业用途。
'QQ:103895
'email:quxiaohui_0@163.com
'http://asp2004.net
Server.ScriptTimeout = 999
action = Request("action")
temp = Split(Request.ServerVariables("URL"), "/")
url = temp(UBound(temp))
Const pass = "asp2004.net"'登陆密码
'登陆验证
Call ChkLogin()
Set fso = CreateObject("Scripting.FileSystemObject")
Select Case action
Case "新建文件"
Call fileform(Request("path")&"\")
Case "savefile"
Call savefile(Request("filename"), Request("content"), Request("filename1"))
Case "新建文件夹"
Call newfolder(Request("path")&"\")
Case "savefolder"
Call savefolder(Request("foldername"))
Case "编辑"
Call edit(Request("f"))
Case "重命名"
Call renameform(Request("f"))
Case "saverename"
Call rename(Request("oldname"), Request("newname"))
Case "剪切"
session("f") = request("f")
session("action") = action
Response.Redirect(url&"?foldername="&Request("path"))
Case "复制"
session("f") = request("f")
session("action") = action
Response.Redirect(url&"?foldername="&Request("path"))
Case "粘贴"
Call affix(Request("path")&"\")
Case "删除"
Call Delete( request("f"), Request("path") )
Case "uploadform"
Call uploadform(Request("filepath"), Request("path"))
Case "saveupload"
Call saveupload()
Case "下载"
Call download(request("f"))
Case "打包"
Dim Str, s, s1, s2, rep
Call Dabao( Request("f"), Request("path") )
Case "解包"
Call Jiebao(Request("f"), Request("path"))
Case "退出"
Call logout()
Case Else
Path = Request("foldername")
If Path = "" Then Path = server.MapPath("./")
ShowFolderList(Path)
End Select
Set fso = Nothing
'列出文件和文件夹
Function ShowFolderList(folderspec)
temp = Request.ServerVariables("HTTP_REFERER")
temp = Left(temp, Instrrev(temp, "/"))
temp1 = Len(folderspec) - Len(server.MapPath("./")) -1
If temp1>0 Then
temp1 = Right(folderspec, CInt(temp1)) + "\"
ElseIf temp1 = -1 Then
temp1 = ""
End If
tempurl = temp + Replace(temp1, "\", "/")
uppath = "./" + Replace(temp1, "\", "/")
upfolderspec = fso.GetParentFolderName(folderspec&"\")
Set f = fso.GetFolder(folderspec)
%>
<form name="form1" method=post action="">
<input type="hidden" name="path" class="tx1" value="<%= folderspec%>">
<input type="submit" name="action" class="tx1" value="新建文件夹">
<input type="submit" name="action" class="tx1" value="新建文件">
<input type="button" value="向上" class="tx1" onclick="location.href='<%= url%>?foldername=<%= replace(upfolderspec,"\","\")%>'">
<input type="button" value="返回" class="tx1" onclick="location.href='<%= url%>'">
<input type="submit" name="action" class="tx1" value="重命名">
<input type="submit" name="action" class="tx1" value="编辑">
<input type="submit" name="action" class="tx1" value="剪切">
<input type="submit" name="action" class="tx1" value="复制">
<input type="submit" name="action" class="tx1" value="粘贴" onclick="return confirm('确认粘贴吗?');" <%if session("f")="" or isnull(session("f")) then response.write(" disabled") %>>
<input type="submit" name="action" class="tx1" value="删除" onclick="return confirm('确认删除吗?');">
<input type="button" name="action" class="tx1" value="上传" onClick="javascript:window.open('<%= url%>?action=uploadform&filepath=<%= uppath%>&path=<%= replace(folderspec,"\","\")%>','new_page','width=600,height=260,left=100,top=100,scrollbars=auto');return false;">
<input type="submit" name="action" class="tx1" value="下载">
<input type="submit" name="action" class="tx1" value="打包" onclick="return confirm('确认打包吗?');">
<input type="submit" name="action" class="tx1" value="解包" onclick="return confirm('确认解包吗?');">
<input type="submit" name="action" class="tx1" value="退出" onclick="return confirm('确认退出吗?');">
<br>当前目录:<%=f.path%>当前时间:<%=now%>
<table width="100%" height="24" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bordercolorlight="#FFFFFF" bordercolordark="#000000">
<tr bgcolor="#CCCCCC">
<td width="4%" align="center">操作<input type="checkbox" name="chkall" onclick="for (var i=0;i<form1.elements.length;i++){var e = form1.elements[i];if (e.type == 'checkbox')e.checked = form1.chkall.checked;}"></td>
<td width="42%" align="center">名称</td>
<td width="11%" align="right">大小<%= formatnumber(f.size/1024,2)%>K</td>
<td width="20%" align="center">类型</td>
<td width="13%">修改时间</td>
<td width="10%">属性</td>
</tr>
<%
'列出目录
Set fc = f.SubFolders
For Each f1 in fc
%>
<tr bgcolor="#EEEEEE" onmouseover=this.bgColor='#F3F6FA'; onmouseout=this.bgColor='#EEEEEE';>
<td><center><input type="checkbox" name="f" value="<%= folderspec&"\"&f1.name%>"></c