?? folderimagelist.asp
字號:
<% Option Explicit %>
<!--#include file="../../FS_Inc/Const.asp" -->
<!--#include file="../../FS_Inc/Function.asp"-->
<!--#include file="../../FS_InterFace/MF_Function.asp" -->
<!--#include file="../lib/strlib.asp" -->
<!--#include file="../lib/UserCheck.asp" -->
<%
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
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
if trim(Request.QueryString("f_UserNumber"))="" then response.Write("登陸過期,或者參數(shù)不正確"):response.end
if trim(Request.QueryString("f_UserNumber"))<>Fs_User.UserNumber then response.Write("錯誤參數(shù)"):response.end
Dim TypeSql,RsTypeObj,LableSql,RsLableObj
Dim CurrPath,FsoObj,SubFolderObj,FolderObj,FileObj,i,FsoItem,OType
Dim ParentPath,FileExtName,AllowShowExtNameStr,str_CurrPath
Dim ShowVirtualPath,sRootDir
if G_VIRTUAL_ROOT_DIR<>"" then sRootDir="/" & G_VIRTUAL_ROOT_DIR else sRootDir=""
CurrPath = Replace("/"&G_VIRTUAL_ROOT_DIR &"/"&G_USERFILES_DIR&"/"&Session("FS_UserNumber"),"//","/")
If ReplaceExpChar(Replace(CurrPath,"/","")) = False Then
Response.Write "<script>alert('您想干什么?\n您的IP已經(jīng)被記錄!\n我們將收集您部分計算機資料');window.location.href='javascript:history.back();';</script>"
Response.End
End If
Set FsoObj = Server.CreateObject(G_FS_FSO)
OType = Request("Type")
if OType <> "" then
Dim Path,PhysicalPath
if OType = "DelFolder" then
Path = Request("Path")
If Instr(Path,".") <> 0 Or Instr(Path,"/") = 0 Or Left(Path,1) <> "/" Then
Response.Write "<script>alert('需要刪除的目錄路徑不正確哦');window.location.href='FolderImageList.asp';</script>"
Response.End
End If
Path = Right(Path,Len(Path) - 1)
If UBound(Split(Path,"/")) < 2 Then
Response.Write "<script>alert('需要刪除的目錄路徑不正確哦');window.location.href='FolderImageList.asp';</script>"
Response.End
End If
If Cstr(Split(Path,"/")(1)) <> Cstr(Session("FS_UserNumber")) Then
Response.Write "<script>alert('不能刪除別人的目錄哦');window.location.href='FolderImageList.asp';</script>"
Response.End
End If
Path = "/" & Path
Path = Server.MapPath(Path)
if FsoObj.FolderExists(Path) = true then FsoObj.DeleteFolder Path
elseif OType = "DelFile" then
Dim DelFileName
Path = Request("Path")
If Instr(Path,".") <> 0 Or Instr(Path,"/") = 0 Or Left(Path,1) <> "/" Then
Response.Write "<script>alert('需要刪除的文件路徑不正確哦');window.location.href='FolderImageList.asp';</script>"
Response.End
End If
Path = Right(Path,Len(Path) - 1)
If UBound(Split(Path,"/")) < 1 Then
Response.Write "<script>alert('需要刪除的文件路徑不正確哦');window.location.href='FolderImageList.asp';</script>"
Response.End
End If
If Cstr(Split(Path,"/")(1)) <> Cstr(Fs_User.UserNumber) Then
Response.Write "<script>alert('不能刪除別人的文件哦');window.location.href='FolderImageList.asp';</script>"
Response.End
End If
Path = "/" & Path
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 <> "") then
Path = Server.MapPath(Path)
if FsoObj.FileExists(Path & "\" & DelFileName) = true then FsoObj.DeleteFile Path & "\" & DelFileName
end if
elseif OType = "AddFolder" then
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('新的目錄名不規(guī)范,請重設(shè)');window.location.href='FolderImageList.asp';</script>"
Response.End
End If
Path = Server.MapPath(Path)
if FsoObj.FolderExists(Path) = True then
Response.Write("<script>alert('目錄已經(jīng)存在');</script>")
else
FsoObj.CreateFolder Path
end if
end if
End If
end if
ShowVirtualPath = Request("ShowVirtualPath")
AllowShowExtNameStr = "jpg,txt,gif,bmp,png"
CurrPath = Replace(Request("CurrPath"),"//","/")
If ReplaceExpChar(Replace(CurrPath,"/","")) = False Then
Response.Write "<script>alert('您想干什么?\n您的IP已經(jīng)被記錄!\n我們將收集您部分計算機資料');window.location.href='javascript:history.back();';</script>"
Response.End
End If
if CurrPath = "" then
CurrPath = Replace("/"&G_VIRTUAL_ROOT_DIR &"/"&G_USERFILES_DIR&"/"&Session("FS_UserNumber"),"//","/")
ParentPath = ""
else
ParentPath = Mid(CurrPath,1,InstrRev(CurrPath,"/")-1)
if ParentPath = "" then
CurrPath = Replace("/"&G_VIRTUAL_ROOT_DIR &"/"&G_USERFILES_DIR&"/"&Session("FS_UserNumber"),"//","/")
end if
end if
dim CurrPath1
CurrPath1 = Server.MapPath(replace(Replace(CurrPath,"\\","\"),"/","\"))
if FsoObj.FolderExists(CurrPath1) = false then FsoObj.CreateFolder CurrPath1
Set FolderObj = FsoObj.GetFolder(Server.MapPath(CurrPath))
Set SubFolderObj = FolderObj.SubFolders
Set FileObj = FolderObj.Files
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="../../<% = G_USER_DIR %>/images/skin/Css_<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>/<%=Request.Cookies("FoosunUserCookies")("UserLogin_Style_Num")%>.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
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();\"> ";
else MenuRowStr+="> ";
MenuRowStr=MenuRowStr+MenuDescription+"<\/td><\/tr>";
return MenuRowStr;
}
</script>
<body topmargin="0" leftmargin="0" onClick="SelectFolder();" class="hback">
<table width="99%" border="0" align="center" cellpadding="2" cellspacing="0" class="hback">
<%
if lcase(Trim(CurrPath))<> lcase(Trim(str_CurrPath)) then
%>
<tr title="上級目錄<% = ParentPath %>" onClick="SelectUpFolder(this);" Path="<% = ParentPath %>" onDblClick="OpenParentFolder(this);">
<td colspan="2"> <table width="62" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="21"><font color="#FFFFFF"><img src="../Images/folder.gif" width="20" height="16"></font></td>
<td width="41">...</td>
</tr>
</table></td>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -