web文件管理器的后续开发(2)
ShowFolderList(Path)
Set fso = Nothing
'列出文件和文件夹
Function ShowFolderList(folderspec)
temp = Request.ServerVariables("HTTP_REFERER")
temp = Left(temp, Instrrev(temp, "/"))
temp1 = Len(folderspec) - Len(server.MapPath("./")) -1
If temp1>0 Then
temp1 = Right(folderspec, CInt(temp1)) + "\"
ElseIf temp1 = -1 Then
temp1 = ""
End If
tempurl = temp + Replace(temp1, "\", "/")
uppath = "./" + Replace(temp1, "\", "/")
upfolderspec = fso.GetParentFolderName(folderspec&"\")
Set f = fso.GetFolder(folderspec)
%>
<script language="javascript">
function File(Name, Size, Type, DateCreated, DateLastAccessed, DateLastModified, Attributes)
{
this.Name = Name;
this.Size = Size;
this.Type = Type;
this.DateCreated = DateCreated;
this.DateLastAccessed = DateLastAccessed;
this.DateLastModified = DateLastModified;
this.Attributes = Attributes;
}
function Tree(id, name)
{
this.id = id;
this.name = name;
this.root = new Array();
this.length = 0;
this.Add = function(file)
{
this.root.push(file);
this.length += 1;
}
this.max = function(f1, f2, field)
{
switch( field )
{
case "Name":
return f1.Name.toLowerCase()>f2.Name.toLowerCase()? true:false;
case "Size":
return f1.Size>f2.Size? true:false;
case "Type":
//if (field == '???t?D') return false;
return f1.Type>f2.Type? true:false;
case "DateCreated":
return f1.DateCreated>f2.DateCreated? true:false;
case "DateLastAccessed":
return f1.DateLastAccessed>f2.DateLastAccessed? true:false;
case "DateLastModified":
return f1.DateLastModified>f2.DateLastModified? true:false;
内容版权声明:除非注明,否则皆为本站原创文章。