📄 file.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="inc/function.asp"-->
<!--#include file="inc/driver.asp"-->
<%
'--------------------------------------------
if session("adminlogin")="" then
response.redirect("login.asp")
end if
'--------------------------------------------
order = trim(request("type"))
questa = GetPathWith(request("a"))
questb = GetPathWith(request("b"))
'------------------检查权限是否正确--------------------------------************
theFilea = Split(questa,"|")
theFileb = Split(questb,"|")
boundA = UBound(theFilea)
boundB = UBound(theFileb)
For i = 0 to boundA
if not session("admin") and theFilea(i) <> "" then
'-------此处检查权限
myPatha = Split(session("dir"), "|")
flaga = false
For each subDir in myPatha
If InStr(theFilea(i), lcase(subDir)) > 0 then
flaga = true
end if
Next
If flaga = false then
response.write("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>")
response.write("<script language=javascript>")
response.write("alert(""你没有权限访问该目录!"");")
response.write("self.close();")
response.write("</script>")
response.end
end if
end if
Next
'------------------------------------------------------------------
For i = 0 to boundB
if not session("admin") and theFileb(i) <> "" then
'-------此处检查权限
myPathb = Split(session("dir"), "|")
For each subDir in myPathb
If InStr(theFileb(i), lcase(subDir)) > 0 then
flagb = true
end if
Next
If flagb = false then
response.write("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>")
response.write("<script language=javascript>")
response.write("alert(""你没有权限访问该目录!"");")
response.write("self.close();")
response.write("</script>")
response.end
end if
end if
Next
'----------------检测是否是有效路径
For i = 0 to boundA
If theFilea(i) <> "" then
if not CheckCorrectPath(theFilea(i)) then
response.write("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>")
response.write("<script language=javascript>")
response.write("alert(""请求为非有效目录或包含非法字符!"");")
response.write("self.close();")
response.write("</script>")
response.end
end if
end if
Next
'--------------
For i = 0 to boundB
If theFileb(i) <> "" then
if not CheckCorrectPath(theFileb(i)) then
response.write("<meta http-equiv='Content-Type' content='text/html; charset=gb2312'>")
response.write("<script language=javascript>")
response.write("alert(""请求为非有效目录或包含非法字符!"");")
response.write("self.close();")
response.write("</script>")
response.end
end if
end if
Next
'------------------------------------------------------------------***************
For i = 0 to boundB
If Right(theFileb(i),1) <> "\" and theFileb(i) <> "" Then '------确保是类f:\test\test\
theFileb(i) = theFileb(i) & "\"
End If
Next
'---------------------
For i = 0 to boundA
If Right(theFilea(i),1) = "\" and theFilea(i) <> "" Then '------确保是类f:\test\test
theFilea(i) = Mid(theFilea(i),1,Len(theFilea(i))-1)
End If
Next
'------------------------------------------------------------------
If questb = "" then
Select Case order
Case "copyfile"
For each a in theFilea
call checka()
Next
title = "复制文件"
Case "movefile"
For each a in theFilea
call checka()
Next
title = "移动文件"
Case "delfile"
For each a in theFilea
call checka()
Next
title = "删除文件"
flag = true
Case "renamefile"
For each a in theFilea
call checka()
Next
title = "文件改名"
Case "mdfile"
For each a in theFilea
call checka()
Next
title = "新建文件"
flag = true
Case "mdfolder"
title = "新建目录"
flag = true
Case "copyfolder"
title = "复制目录"
Case "movefolder"
title = "移动目录"
Case "renamefolder"
title = "目录改名"
Case "delfolder"
title = "删除目录"
flag = true
End Select
Else
Select Case order
Case "copyfile"
For each a in theFilea
call checka()
Next
title = "复制文件"
flag=true
Case "movefile"
For each a in theFilea
call checka()
Next
title = "移动文件"
flag=true
Case "copyfolder"
title = "复制目录"
flag = true
Case "movefolder"
title = "移动目录"
flag = true
Case "mdfolder"
title = "新建目录"
flag = true
Case "mdfile"
For each a in theFilea
call checka()
Next
title = "新建文件"
flag = true
Case "renamefolder"
title = "目录改名"
flag = true
Case "renamefile"
For each a in theFilea
call checka()
Next
For each b in theFileb
call checkb()
Next
title = "文件改名"
flag = true
End Select
End if
%>
<%
if title="" then
title="非法或无效请求!"
end if
'---------------------------------------a->questa--b->questb---------------------
%>
<html>
<head>
<title><%= title %>--<%=name%>--[By BrightStar]</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<Meta Name="description" Content="BS在线文件管理系统">
<Meta Name="Keywords" Content="BS在线文件管理系统">
<meta http-equiv="pragma" content="no-cache">
<link href="styles.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#CCCCCC" topmargin="0" leftmargin="0">
<table height="110" width="280" border="0" align="center" cellpadding="1" cellspacing="0">
<tr><td align="center" height="90" valign="middle">
<% if flag = true then
Select Case order
Case "copyfile"
for each subFile in theFilea
call copyFile(subFile, theFileb(0))
response.write("<br>")
next
Case "movefile"
for each subFile in theFilea
call moveFile(subFile, theFileb(0))
response.write("<br>")
next
Case "delfile"
for each subFile in theFilea
call delFile(subFile)
response.write("<br>")
next
Case "copyfolder"
for each subFolder in theFilea
call copyFolder(subFolder, theFileb(0))
response.write("<br>")
next
Case "movefolder"
for each subFolder in theFilea
call moveFolder(subFolder, theFileb(0))
response.write("<br>")
next
Case "delfolder"
for each subFolder in theFilea
call delFolder(subFolder)
response.write("<br>")
next
Case "mdfolder"
for i = 0 to boundA
call createFolder(theFilea(i))
response.write("<br>")
next
Case "mdfile"
for i = 0 to boundA
call createFile(theFilea(i),"")
response.write("<br>")
next
Case "renamefolder"
theFileb(0) = Mid(theFileb(0),1,Len(theFileb(0))-1)
call renameFolder(theFilea(0),theFileb(0))
Case "renamefile"
theFileb(0) = Mid(theFileb(0),1,Len(theFileb(0))-1)
call renameFile(theFilea(0),theFileb(0))
Case else
response.write("非法或无效请求!")
End Select
else
response.write("非法或无效请求!")
end if %>
</td></tr>
<tr>
<td align=center height=20>
<input type="button" name="Button" value=" 确 定 " onclick="window.close();" class="button"></td>
</tr>
</table>
<table width="280" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td height="10"></td>
</tr>
</table>
<table width="280" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td bgcolor="#ccaacc" height="1"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
<tr>
<td align="center"><%=copyright%></td>
</tr>
</table>
</body>
<Script language="javascript">
<!--//
window.opener.location.reload();
//-->
</Script>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -