⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 folderimagelist.asp

📁 后台目录:qwbAdmin/Login.asp 登陆用户名:admin 登陆密码:admin
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<% Option Explicit %>
<!--#include file="../../../FS_Inc/Const.asp" -->
<!--#include file="../../../FS_Inc/Function.asp"-->
<!--#include file="../../../FS_Inc/md5.asp" -->
<!--#include file="../../../FS_InterFace/MF_Function.asp" -->
<%
Dim Conn
MF_Default_Conn
MF_Session_TF
Dim TypeSql,RsTypeObj,LableSql,RsLableObj
Set FsoObj = Server.CreateObject(G_FS_FSO)
Dim CurrPath,FsoObj,SubFolderObj,FolderObj,FileObj,i,FsoItem,OType
Dim ParentPath,FileExtName,AllowShowExtNameStr,str_CurrPath
Dim ShowVirtualPath,sRootDir
Dim UpLoadFileNameStr
UpLoadFileNameStr = Conn.ExeCute("Select MF_UpFile_Type From FS_MF_Config Where ID > 0")(0)
if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/" & G_VIRTUAL_ROOT_DIR else sRootDir=""
If Session("Admin_Is_Super") = 1 then
	str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
Else
	If Session("Admin_FilesTF") = 0 Then
		str_CurrPath = Replace(sRootDir &"/"&G_UP_FILES_DIR&"/adminfiles/"&UCase(md5(Session("Admin_Name"),16)),"//","/")
	Else
		str_CurrPath = sRootDir &"/"&G_UP_FILES_DIR
	End If	
End if

OType = Request("Type")
if OType <> "" then
	Dim Path,PhysicalPath
	if OType = "DelFolder" then
		if not MF_Check_Pop_TF("MF027") then Err_Show
		Path = Trim(Request("Path")) 
		If Instr(Path,".") > 0 Then
			Response.Write "<script>alert('需要删除的目录路径不正确哦');window.location.href='FolderImageList.asp';</script>"
			Response.End
		End If
		If LCase(Cstr(Left(Right(Path,Len(Path) - 1),Len(G_UP_FILES_DIR)))) <> LCase(Cstr(G_UP_FILES_DIR)) Then
			Response.Write "<script>alert('需要删除的目录路径不正确哦');window.location.href='FolderImageList.asp';</script>"
			Response.End
		End If	
		if Path <> "" then
			Path = Server.MapPath(Path)
			if FsoObj.FolderExists(Path) = true then FsoObj.DeleteFolder Path
		end if
	elseif OType = "DelFile" then
		if not MF_Check_Pop_TF("MF027") then Err_Show
		Dim DelFileName
		Path = Trim(Request("Path"))
		If Instr(Path,".") > 0 Then
			Response.Write "<script>alert('需要删除的文件路径不正确哦');window.location.href='FolderImageList.asp';</script>"
			Response.End
		End If
		If LCase(Cstr(Left(Right(Path,Len(Path) - 1),Len(G_UP_FILES_DIR)))) <> LCase(Cstr(G_UP_FILES_DIR)) Then
			Response.Write "<script>alert('需要删除的文件路径不正确哦');window.location.href='FolderImageList.asp';</script>"
			Response.End
		End If 
		DelFileName = Request("FileName")
		If Instr(DelFileName,"/") <> 0 Or Instr(DelFileName,"\") <> 0 Or Left(DelFileName,1) = "." Then
			Response.Write "<script>alert('需要删除的文件路径不正确哦');window.location.href='FolderImageList.asp';</script>"
			Response.End
		End If
		if (DelFileName <> "") And (Path <> "") then
			Path = Server.MapPath(Path)
			if FsoObj.FileExists(Path & "\" & DelFileName) = true then FsoObj.DeleteFile Path & "\" & DelFileName
		end if
	elseif OType = "AddFolder" then
		if not MF_Check_Pop_TF("MF028") then Err_Show
		Path = Request("Path")
		if Path <> "" then
			Dim FildNameStr
			If Right(Path,1) = "/" Then
				Path = Left(Path,Len(Path) - 1)
			End If
			FildNameStr = Split(Path,"/")(Ubound(Split(Path,"/")))
			If ReplaceExpChar(FildNameStr) = False Then
				Response.Write "<script>alert('新的目录名不规范,请重设');window.location.href='FolderImageList.asp';</script>"
				Response.End
			End If
			Path = Server.MapPath(Path)
			if FsoObj.FolderExists(Path) = True then
				Response.Write("<script>alert('目录已经存在');</script>")
			else
				FsoObj.CreateFolder Path
			end if
		end if
	elseif OType = "FileReName" then
		if not MF_Check_Pop_TF("MF026") then Err_Show
		Dim NewFileName,OldFileName,NewArr,Arr_i,NameTF
		Path = Request("Path")
		if Path <> "" then
			NewFileName = Request("NewFileName")
			OldFileName = Request("OldFileName")
			IF Ubound(Split(NewFileName,".")) <> 1 Then
				Response.Write "<script>alert('新的文件名不规范,请重设');window.location.href='FolderImageList.asp';</script>"
				Response.End
			End If
			NewArr = Split(UpLoadFileNameStr,",")
			NameTF = False
			For Arr_i = LBound(NewArr) To Ubound(NewArr)
				IF NewArr(Arr_i) = Split(NewFileName,".")(1) Then
					NameTF = True
					Exit For
				End If	
			NExt
			IF NameTF = False Then
				Response.Write "<script>alert('新的文件扩展名不被允许,请重设');window.location.href='FolderImageList.asp';</script>"
				Response.End
			End If	
			if (NewFileName <> "") And (OldFileName <> "") then
				PhysicalPath = Server.MapPath(Path) & "\" & OldFileName
				if FsoObj.FileExists(PhysicalPath) = True then
					PhysicalPath = Server.MapPath(Path) & "\" & NewFileName
					if FsoObj.FileExists(PhysicalPath) = False then
						Set FileObj = FsoObj.GetFile(Server.MapPath(Path) & "\" & OldFileName)
						FileObj.Name = NewFileName
						Set FileObj = Nothing
					end if
				end if
			end if
		end if
	elseif OType = "FolderReName" then
		if not MF_Check_Pop_TF("MF026") then Err_Show
		Dim NewPathName,OldPathName
		Path = Request("Path")
		if Path <> "" then
			NewPathName = Request("NewPathName")
			OldPathName = Request("OldPathName")
			If ReplaceExpChar(NewPathName) = False Then
				Response.Write "<script>alert('新的目录名不规范,请重设');window.location.href='FolderImageList.asp';</script>"
				Response.End
			End If	
			if (NewPathName <> "") And (OldPathName <> "") then
				PhysicalPath = Server.MapPath(Path) & "\" & OldPathName
				if FsoObj.FolderExists(PhysicalPath) = True then
					PhysicalPath = Server.MapPath(Path) & "\" & NewPathName
					if FsoObj.FolderExists(PhysicalPath) = False then
						Set FileObj = FsoObj.GetFolder(Server.MapPath(Path) & "\" & OldPathName)
						FileObj.Name = NewPathName
						Set FileObj = Nothing
					end if
				end if
			end if
		end if
	end if
end if
ShowVirtualPath = Request("ShowVirtualPath")
AllowShowExtNameStr = "jpg,txt,gif,bmp,png"
CurrPath = Replace(Request("CurrPath"),"//","/")
if G_VIRTUAL_ROOT_DIR <>"" then
	if Trim(CurrPath) = "/"  or  Trim(CurrPath) =G_UP_FILES_DIR &"/"  or lcase(Trim(CurrPath)) = lcase(G_UP_FILES_DIR &"/Foosun_Data") then
		Response.Write("非法参数")
		Response.end
	End if
Else
	if Trim(CurrPath) = "/"  or lcase(Trim(CurrPath)) = lcase("/Foosun_Data") then
		Response.Write("非法参数")
		Response.end
	End if
End if
if CurrPath = "" then
	CurrPath = str_CurrPath
	ParentPath = ""
else
	ParentPath = Mid(CurrPath,1,InstrRev(CurrPath,"/")-1)
	if ParentPath = "" then
		ParentPath =sRootDir &"/adminfiles/"&Session("Admin_Name")
	End If 
End If 

On Error Resume Next
Set FolderObj = FsoObj.GetFolder(Server.MapPath(CurrPath))
Set SubFolderObj = FolderObj.SubFolders
Set FileObj = FolderObj.Files
If Err Then
	Response.write "路径错误"
	Response.End
End If 
Function CheckFileShowTF(AllowShowExtNameStr,ExtName)
	if ExtName="" then
		CheckFileShowTF = False
	else
		if InStr(1,AllowShowExtNameStr,ExtName) = 0 then
			CheckFileShowTF = False
		else
			CheckFileShowTF = True
		end if
	end if
End Function

Function ReplaceExpChar(Str)
	Dim RegEx,StrRs,S_Str,ReturnV,HaveV
	S_Str = Str & ""
	ReturnV = True
	Set RegEx = New RegExp
	RegEx.IgnoreCase = True
	RegEx.Global=True
	RegEx.Pattern = "([^a-zA-Z0-9])"
	Set StrRs = RegEx.ExeCute(S_Str)
	Set RegEx = Nothing
	For Each HaveV In StrRs
		If Instr(S_Str,HaveV) <> 0 Then
			ReturnV = False
			Exit For
		End IF	
	Next
	ReplaceExpChar = ReturnV
End Function
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>文件和目录列表</title>
</head>
<style>
.TempletItem {
	cursor: default;
}
.TempletSelectItem {
	background-color:highlight;
	cursor: default;
	color: white;
}
</style>
<link href="../../images/skin/Css_<%=Session("Admin_Style_Num")%>/<%=Session("Admin_Style_Num")%>.css" rel="stylesheet" type="text/css">
<script language="javascript" src="../../../FS_Inc/prototype.js"></script>
<script language="JavaScript">
var CurrPath='<% = CurrPath %>';
var MFDomain='<%= Request.Cookies("FoosunMFCookies")("FoosunMFDomain") %>';
var G_VIRTUAL_ROOT_DIR='<% = G_VIRTUAL_ROOT_DIR %>';
var ObjPopupMenu=window.createPopup();
document.oncontextmenu=new Function("return ShowMouseRightMenu(window.event);");
function ShowMouseRightMenu(event)
{
	ContentMenuShowEvent();
	var width=100;
	var height=0;
	var lefter=event.clientX;
	var topper=event.clientY;
	var ObjPopDocument=ObjPopupMenu.document;
	var ObjPopBody=ObjPopupMenu.document.body;
	var MenuStr='';
	for (var i=0;i<ContentMenuArray.length;i++)
	{
		if (ContentMenuArray[i].ExeFunction=='seperator')
		{
			MenuStr+=FormatSeperator();
			height+=16;
		}
		else
		{
			MenuStr+=FormatMenuRow(ContentMenuArray[i].ExeFunction,ContentMenuArray[i].Description,ContentMenuArray[i].EnabledStr);
			height+=20;
		}
	}
	MenuStr="<TABLE border=0 cellpadding=0 cellspacing=0 class=Menu width=100>"+MenuStr
	MenuStr=MenuStr+"<\/TABLE>";
	ObjPopDocument.open();
	ObjPopDocument.write("<head><link href=\"select_css.css\" type=\"text/css\" rel=\"stylesheet\"></head><body scroll=\"no\" onConTextMenu=\"event.returnValue=false;\" onselectstart=\"event.returnValue=false;\">"+MenuStr);
	ObjPopDocument.close();
	height+=4;
	if(lefter+width > document.body.clientWidth) lefter=lefter-width;
	ObjPopupMenu.show(lefter, topper, width, height, document.body);
	return false;
}
function FormatSeperator()
{
	var MenuRowStr="<tr><td height=16 valign=middle><hr><\/td><\/tr>";
	return MenuRowStr;
}
function FormatMenuRow(MenuOperation,MenuDescription,EnabledStr)
{
	var MenuRowStr="<tr "+EnabledStr+"><td align=left height=20 class=MouseOut onMouseOver=this.className='MouseOver'; onMouseOut=this.className='MouseOut'; valign=middle"
	if (EnabledStr=='') MenuRowStr+=" onclick=\""+MenuOperation+"parent.ObjPopupMenu.hide();\">&nbsp;&nbsp;&nbsp;&nbsp;";
	else MenuRowStr+=">&nbsp;&nbsp;&nbsp;&nbsp;";
	MenuRowStr=MenuRowStr+MenuDescription+"<\/td><\/tr>";
	return MenuRowStr;
}
function AutoSelectFile(Obj)
{	for (var i=0;i<document.all.length;i++)
	{
		if (document.all(i).className=='TempletSelectItem') document.all(i).className='TempletItem';
	}
	Obj.className='TempletSelectItem';
}
function AutoSetFile(Obj)
{
		var PathInfo='',TempPath='';
		//if (G_VIRTUAL_ROOT_DIR!='')
		//{
			//TempPath=CurrPath;
			//PathInfo=TempPath.substr(TempPath.indexOf(G_VIRTUAL_ROOT_DIR)+G_VIRTUAL_ROOT_DIR.length);
		//}
		//else
		//{
			PathInfo=CurrPath;
		//}
	//PathInfo="Http://"+MFDomain+PathInfo;
	if (CurrPath=='/')	window.returnValue=PathInfo+Obj.File;
	else window.returnValue=PathInfo+'/'+Obj.File;
	window.parent.document.all.UserUrl.value=window.returnValue;
}


function Order_AllFiles(Obj)
{
	var Order_ID = Obj.id;
	var Order_Text = 0;
	if (Order_ID.indexOf("_") != -1)
	{
		var TempArr = Order_ID.split("_");
		Order_Text = TempArr[1];
	}
	var Order_Type = Obj.value;
	if (Order_Type == "" || Order_Type == null)
	{
		Order_Type = 0;
	}
	else
	{
		if (Order_Type == "0")
		{
			Order_Type = "1";
		}
		else
		{
			Order_Type = "0";
		}
	}
	var Request = window.location.href;
	Request = Request.replace(/(\&Order_Text).*$/img,"");
	Request = Request.replace(/(\&Order_Type).*$/img,"");
	if (Request.indexOf("?") != -1)
		{
			window.location.href = Request + "&Order_Text=" + Order_Text + "&Order_Type=" + Order_Type;
		}
		else
		{
			window.location.href = Request + "?Order_Text=" + Order_Text + "&Order_Type=" + Order_Type;
		}
}


</script>
<script language="JavaScript">
var CurrPath='<% = CurrPath %>';
var G_VIRTUAL_ROOT_DIR='<% = G_VIRTUAL_ROOT_DIR %>';
var ShowVirtualPath='<% = ShowVirtualPath %>';
var SelectedObj=null;
var ContentMenuArray=new Array();
DocumentReadyTF=false;
function document.onreadystatechange()
{
	if (DocumentReadyTF) return;
	InitialClassListContentMenu();
	DocumentReadyTF=true;
}
function ContentMenuFunction(ExeFunction,Description,EnabledStr)
{
	this.ExeFunction=ExeFunction;
	this.Description=Description;
	this.EnabledStr=EnabledStr;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -