<!--#include file="../../fy.Function.asp"-->
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>fso操作</title>
<link rel="stylesheet" type="text/css" href="../../css/base.css">
<link rel="stylesheet" type="text/css" href="../../css/content.css">
</head>
<body>
<script type="text/javascript">
	var api = frameElement.api, W = api.opener;
</script><%
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0 
Response.CacheControl = "no-cache"
 If Not fycms.ChkAdmin() Then '超级管理员检测
	Call fycms.fycmsErr("")
 End If 
Dim iname
iname=fycms.s("iname")
Dim ACT_Path,ACT_TypePath,str_ShowPath,strShowErr
ACT_TypePath=replace(replace(Request("ShowPath"),"'",""),"""","")
If ACT_TypePath="" Then
	ACT_TypePath=fycms.fycms_Sys(3)&fycms.fycms_Sys(19)
	str_ShowPath = fycms.fycms_Sys(3)&fycms.fycms_Sys(19)
Else
	str_ShowPath =ACT_TypePath
End If
 ACT_Path = Mid(ACT_TypePath,1,InstrRev(ACT_TypePath,"/")-1)
Dim ACT_FSO,ACT_FolderObj,ACT_SubFolderObj,p_FileObj,FileIconDic
Dim ACT_FileItem
Set ACT_FSO = Server.CreateObject("scripting.filesystemobject")
Set ACT_FolderObj = ACT_FSO.GetFolder(Server.MapPath(ACT_TypePath))
Set ACT_SubFolderObj = ACT_FolderObj.SubFolders
Set p_FileObj = ACT_FolderObj.Files
Set FileIconDic = CreateObject("Scripting.Dictionary")
FileIconDic.Add "txt","FileIcon/txt.gif"
FileIconDic.Add "gif","FileIcon/gif.gif"
FileIconDic.Add "exe","FileIcon/exe.gif"
FileIconDic.Add "asp","FileIcon/asp.gif"
FileIconDic.Add "html","FileIcon/html.gif"
FileIconDic.Add "htm","FileIcon/html.gif"
FileIconDic.Add "jpg","FileIcon/jpg.gif"
FileIconDic.Add "jpeg","FileIcon/jpg.gif"
FileIconDic.Add "pl","FileIcon/perl.gif"
FileIconDic.Add "perl","FileIcon/perl.gif"
FileIconDic.Add "zip","FileIcon/zip.gif"
FileIconDic.Add "rar","FileIcon/zip.gif"
FileIconDic.Add "gz","FileIcon/zip.gif"
FileIconDic.Add "doc","FileIcon/doc.gif"
FileIconDic.Add "xml","FileIcon/xml.gif"
FileIconDic.Add "xsl","FileIcon/xml.gif"
FileIconDic.Add "dtd","FileIcon/xml.gif"
FileIconDic.Add "vbs","FileIcon/vbs.gif"
FileIconDic.Add "js","FileIcon/vbs.gif"
FileIconDic.Add "wsh","FileIcon/vbs.gif"
FileIconDic.Add "sql","FileIcon/script.gif"
FileIconDic.Add "bat","FileIcon/script.gif"
FileIconDic.Add "tcl","FileIcon/script.gif"
FileIconDic.Add "eml","FileIcon/mail.gif"
FileIconDic.Add "swf","FileIcon/flash.gif"
 
 %>





<div class="content"> 
 
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    <thead>
      <tr>
      <th>名称</th><th width="200">类型</th><th  width="50">大小</th><th width="50">操作</th>
	  </tr>
    </thead>
        <% If ACT_Path <> fycms.fycms_Sys(3) And ACT_Path <> "/" Then %>
	<tr>
        <td colspan="5"><a title="上级目录<% = ACT_Path %>" href="?ShowPath=<% = ACT_Path %>&iname=<%=iname%>">上级目录</span>(<font color=red>点击进入目录</font>)</td>
        </tr>

<%
	End If
	For Each ACT_FileItem In ACT_SubFolderObj
		%>

  <tr>
        <td  class="tl"><img src="FileIcon/folder.gif" width="20" height="16"><a href="?ShowPath=<%=ACT_TypePath%>/<% = ACT_FileItem.name %>&iname=<%=iname%>"> 
              <% = ACT_FileItem.name %>
              </a></td>
		 <td>文件夹</td>
         <td><%
		  if ACT_FileItem.Size<100 then
			 echo ACT_FileItem.Size &"Byte"
		  Else
			 echo FormatNumber(ACT_FileItem.Size/1024,1,-1) &"KB"
		  End if
		  %></td>
        <td></td>
      </tr>
  <%
		Next
		For Each ACT_FileItem In p_FileObj
			Dim p_FileIcon,p_FileExtName
			p_FileExtName = Mid(CStr(ACT_FileItem.Name),Instr(CStr(ACT_FileItem.Name),".")+1)
			If lcase(p_FileExtName)="html" Or lcase(p_FileExtName)="htm" Or lcase(p_FileExtName)="css" Then 
				p_FileIcon = FileIconDic.Item(LCase(p_FileExtName))
				If p_FileIcon = "" Then
					p_FileIcon = "FileIcon/unknown.gif"
				End If
		%>



  <tr>
        <td class="tl"><img src="<% = p_FileIcon %>"><a href="###" onClick="W.document.getElementById('<%=iname%>').value ='<%=rep(str_ShowPath&"/"&ACT_FileItem.name,fycms.actsys&fycms.SysThemePath&"/"&fycms.NowTheme&"/","")%>';api.close();"> <% = ACT_FileItem.Name %></a></td>
        <td><% = ACT_FileItem.Type %></td>
        <td > <%
		  if ACT_FileItem.Size<100 then
			 echo ACT_FileItem.Size &"字节"
		  Else
			 echo FormatNumber(ACT_FileItem.Size/1024,1,-1) &"KB"
		  End if
		  %></td>
        <td><span class="t_success">
		
		
		<a href="###" onClick="W.document.getElementById('<%=iname%>').value ='<%=rep(str_ShowPath&"/"&ACT_FileItem.name,fycms.actsys&fycms.SysThemePath&"/"&fycms.NowTheme&"/","")%>';api.close();">选择</a></td>

      </tr>





 <%
	  else
	  end if
	next
	%>

		<tr>
        <td colspan="5">小提示：点击目录进入下一级目录
		</td>
        </tr>
    </table>

</div>








 

<%
Set ACT_FSO = Nothing
Set ACT_FolderObj = Nothing
Set ACT_SubFolderObj = Nothing
Set FileIconDic = Nothing
%>
  </body>
</html>