📄 admin_explorer.asp
字号:
<%OPTION EXPLICIT%>
<!--#include file="Include/Config.asp"-->
<!--#include file="Include/SQLAdmin.asp"-->
<!--#include file="Include/Conn.asp"-->
<!--#include file="Include/IPLockAdmin.asp"-->
<%dim Admin_Purview:Admin_Purview="3"%>
<html>
<head>
<title>网站文件管理</title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<meta http-equiv="Content-Language" Content="zh-CN">
<meta name="Keywords" Content="">
<meta name="Description" Content="">
<link type="text/css" rel="stylesheet" href="Include/Style.css">
<Script Language="JavaScript" src="Include/Function.js"></Script>
<Script Language="JavaScript" src="Include/PopText.js"></Script>
<Script Language="JavaScript">
<!--
function Admin_Explorer_Check() {
if (document.Admin_Explorer.FF_Name.value=="") {
JS_M_FF_Name.innerHTML="<font color=#FF0000>请填写文件(夹)名称</font>"
document.Admin_Explorer.FF_Name.focus();
return (false);
}
if ((document.Admin_Explorer.FF_Name.value.indexOf('?')!=-1)||(document.Admin_Explorer.FF_Name.value.indexOf('"')!=-1)) {
JS_M_FF_Name.innerHTML="<font color=#FF0000>文件(夹)名称不能包含特殊字符</font>"
document.Admin_Explorer.FF_Name.focus();
return (false);
}
if ((document.Admin_Explorer.FF_Type[0].checked)&&(document.Admin_Explorer.FF_Name.value.indexOf(".")==-1)) {
JS_M_FF_Name.innerHTML="<font color=#FF0000>请填写文件后缀名</font>"
document.Admin_Explorer.FF_Name.focus();
return (false);
}
return true;
}
//-->
</Script>
</head>
<body leftmargin="10" topmargin="10" bgcolor="#FFFFFF">
<!--#include file="Include/Session.asp"-->
<%
dim GuSystemError,GuSystemCode,GuSystemMessage,GuSystemURL
dim GuFEPathD,GuFEPathM,GuFEPathE,i
dim GuFileCentent
dim GuPage
set GuFSO=Server.CreateObject("Scripting.FileSystemObject")
if Trim(Request.QueryString("GuFEPathD"))<>"" then
GuFEPathD=Trim(Request.QueryString("GuFEPathD"))
else
GuFEPathD=Request.Cookies("GuFileExplorerPathDefault")
end if
if GuFEPathD="" or instr(GuFEPathD," ")>0 or instr(GuFEPathD,vbcrlf)>0 or instr(GuFEPathD,":")>0 or instr(GuFEPathD,"\")>0 then
GuFEPathD="/"
elseif right(GuFEPathD,1)<>"/" then
GuFEPathD=GuFEPathD&"/"
end if
if left(GuFEPathD,1)<>"/" then
GuFEPathD="/"&GuFEPathD
end if
GuFEPathM=Server.MapPath(GuFEPathD)
GuFEPathE=Server.URLEncode(GuFEPathD)
Response.Cookies("GuFileExplorerPathDefault")=""&GuFEPathD&""
Response.Cookies("GuFileExplorerPathDefault").Expires=date+1
if Trim(Request.QueryString("GuPage"))<>"" then
GuPage=Trim(Request.QueryString("GuPage"))
else
GuPage=Request.Cookies("GuFileExplorerPage")
end if
if GuPage<>"" and isNumeric(GuPage) then
GuPage=fix(GuPage)
else
GuPage=1
end if
Response.Cookies("GuFileExplorerPage")=GuPage
Response.Cookies("GuFileExplorerPage").Expires=date+1
if Trim(Request.QueryString("GuComm"))<>"" then
dim GuComm,FF_Name,FF_Name_O,FF_Name_N,FFName,GuFEFolderName,GuFEFileName
dim GuFEFolderPathF,GuFEFolderPathN,GuFEFilePathF,GuFEFilePathN
dim isFolderRename,isFileRename
GuComm=Trim(Request.QueryString("GuComm"))
FF_Name=Trim(Request.Form("FF_Name"))
FF_Name=Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(FF_Name,"\","_"),":","_"),"*","_"),"?","_"),"<","_"),">","_"),"|","_"),",","_"),";","_")
if (GuComm="De" or GuComm="Co" or GuComm="Cu") and (isEmpty(Request.Form("GuFolders")) and isEmpty(Request.Form("GuFiles"))) then
GuSystemCode=3
GuSystemMessage="没有选择要操作的文件或文件夹"
call GuMessage()
elseif GuComm="FF" and FF_Name="" then
GuSystemCode=3
GuSystemMessage="没有填写文件(夹)的名称"
call GuMessage()
else
select case GuComm
case "FF"
if Request.Form("GuCN")="FFCreate" and Request.Form("FF_Type")="GuFolder" then
call Admin_Explorer_FolderCreate()
elseif Request.Form("GuCN")="FFCreate" and Request.Form("FF_Type")="GuFile" then
call Admin_Explorer_FileCreate()
elseif Request.Form("GuCN")="FFRename" and Request.Form("FF_Type")="GuFolder" then
call Admin_Explorer_FolderRename()
elseif Request.Form("GuCN")="FFRename" and Request.Form("FF_Type")="GuFile" then
call Admin_Explorer_FileRename()
else
isFolderRename=False
isFileRename=False
call Admin_Explorer(isFolderRename,isFileRename)
end if
case "Na"
if Request.QueryString("GuCN")="FFRename" and Request.QueryString("FFType")="GuFolder" then
isFolderRename=True
isFileRename=False
call Admin_Explorer(isFolderRename,isFileRename)
elseif Request.QueryString("GuCN")="FFRename" and Request.QueryString("FFType")="GuFile" then
isFolderRename=False
isFileRename=True
call Admin_Explorer(isFolderRename,isFileRename)
else
isFolderRename=False
isFileRename=False
call Admin_Explorer(isFolderRename,isFileRename)
end if
case "Ed"
call Admin_Explorer_Editor()
case "ES"
call Admin_Explorer_EditSave()
case "De"
call Admin_Explorer_Delete()
case "Co"
call Admin_Explorer_CopyCut()
case "Cu"
call Admin_Explorer_CopyCut()
case "Pa"
call Admin_Explorer_Paste()
case else
isFolderRename=False
isFileRename=False
call Admin_Explorer(isFolderRename,isFileRename)
end select
end if
else
isFolderRename=False
isFileRename=False
call Admin_Explorer(isFolderRename,isFileRename)
end if
Sub Admin_Explorer_FolderCreate()
GuFEFolderPathN=GuFEPathD&FF_Name
if len(GuFEFolderPathN)>1 and right(GuFEFolderPathN,1)="/" then
GuFEFolderPathN=left(GuFEFolderPathN,len(GuFEFolderPathN)-1)
end if
GuFEFolderPathF=Server.MapPath(GuFEFolderPathN)
dim GuFSO1
set GuFSO1=Server.CreateObject("Scripting.FileSystemObject")
if GuFSO1.folderexists(GuFEFolderPathF) or GuFSO1.fileexists(GuFEFolderPathF) then
GuSystemCode=3
GuSystemMessage="同一目录下,文件(夹)["&FF_Name&"]已经存在"
call GuMessage()
else
GuFSO1.createfolder(GuFEFolderPathF)
GuSystemCode=00
GuSystemMessage="新的文件夹已创建完成"
GuSystemURL="<a href=""Admin_Explorer.asp""><img src=""Images/Admin_Button_OK.gif"" border=""0""></a>"
call GuMessage()
end if
set GuFSO1=Nothing
end sub
Sub Admin_Explorer_FileCreate()
GuFEFilePathN=GuFEPathD&FF_Name
if len(GuFEPathD)>1 and right(GuFEPathD,1)="/" then
GuFEPathD=left(GuFEPathD,len(GuFEPathD)-1)
end if
GuFEFilePathF=Server.MapPath(GuFEFilePathN)
dim GuFSO2
set GuFSO2=Server.CreateObject("Scripting.FileSystemObject")
if GuFSO2.fileexists(GuFEFilePathF) or GuFSO2.folderexists(GuFEFilePathF) then
GuSystemCode=3
GuSystemMessage="同一目录下,文件(夹)["&FF_Name&"]已经存在"
call GuMessage()
else
GuFSO2.createtextfile(GuFEFilePathF)
GuSystemCode=00
GuSystemMessage="新的文件已创建完成"
GuSystemURL="<a href=""Admin_Explorer.asp""><img src=""Images/Admin_Button_OK.gif"" border=""0""></a>"
call GuMessage()
end if
set GuFSO2=Nothing
end sub
Sub Admin_Explorer_FolderRename()
FF_Name_O=Trim(Request.Form("FF_Name_O"))
FF_Name_N=FF_Name
GuFEFolderPathF=GuFEPathM&"\"&FF_Name_O
GuFEFolderPathN=GuFEPathM&"\"&FF_Name_N
dim GuFSO6
set GuFSO6=Server.CreateObject("Scripting.FileSystemObject")
if GuFSO6.folderexists(GuFEFolderPathN) or GuFSO6.fileexists(GuFEFolderPathN) then
GuSystemCode=3
GuSystemMessage="同一目录下,文件(夹)["&FF_Name_N&"]已经存在"
call GuMessage()
elseif GuFSO6.folderexists(GuFEFolderPathF) and GuFSO6.folderexists(GuFEFolderPathN)=false then
GuFSO6.movefolder GuFEFolderPathF,GuFEFolderPathN
GuSystemCode=00
GuSystemMessage="文件夹["&FF_Name_O&"]重命名为["&FF_Name_N&"]已完成"
GuSystemURL="<a href=""Admin_Explorer.asp""><img src=""Images/Admin_Button_OK.gif"" border=""0""></a>"
call GuMessage()
else
GuSystemCode=3
GuSystemMessage="文件夹["&FF_Name_O&"]不存在"
call GuMessage()
end if
set GuFSO6=Nothing
end sub
Sub Admin_Explorer_FileRename()
FF_Name_O=Trim(Request.Form("FF_Name_O"))
FF_Name_N=FF_Name
GuFEFilePathF=GuFEPathM&"\"&FF_Name_O
GuFEFilePathN=GuFEPathM&"\"&FF_Name_N
dim GuFSO7
set GuFSO7=Server.CreateObject("Scripting.FileSystemObject")
if GuFSO7.fileexists(GuFEFilePathN) or GuFSO7.folderexists(GuFEFilePathN) then
GuSystemCode=3
GuSystemMessage="同一目录下,文件(夹)["&FF_Name_N&"]已经存在"
call GuMessage()
elseif GuFSO7.fileexists(GuFEFilePathF) and GuFSO7.fileexists(GuFEFilePathN)=false then
GuFSO7.movefile GuFEFilePathF,GuFEFilePathN
GuSystemCode=00
GuSystemMessage="文件["&FF_Name_O&"]重命名为["&FF_Name_N&"]已完成"
GuSystemURL="<a href=""Admin_Explorer.asp""><img src=""Images/Admin_Button_OK.gif"" border=""0""></a>"
call GuMessage()
else
GuSystemCode=3
GuSystemMessage="文件["&FF_Name_O&"]不存在"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -