pec
If ReportFolderStatus(Folderspec) = 1 Then
fso.deleteFolder (Folderspec)
deleteAFolder = 1
Else
deleteAFolder = -1
End if
End Function
''''显示目录列表
Function ShowFolderList(folderspec)
''''//功能:目录存在时显示此目录下的所有子目录
''''//形参:目录名
''''//返回值:成功为子目录列表,失败为-1
''''//
Dim f, f1, fc, s
If ReportFolderStatus(folderspec) = 1 Then
Set f = fso.GetFolder(folderspec)
Set fc = f.SubFolders
For Each f1 in fc
s = s & f1.name
s = s & "|"
Next
ShowFolderList = s
Else
ShowFolderList = -1
End if
End Function
''''!!!!
''''目录复制
Function CopyAFolder(SourceFolder,DestinationFolder)
''''//功能:源目录存在时,才能对目录进行复制,目的目录无影响
''''//形参:源目录,目的目录
''''//返回值:成功为1,失败为-1
''''//
''''Dim MyFolder
''''If ReportFolderStatus(SourceFolder) = 1 and ReportFolderStatus
(DestinationFolder) = -1 Then
''''Set MyFolder = fso.GetFolder(SourceFolder)
fso.CopyFolder SourceFolder,DestinationFolder
CopyAFolder = 1
''''Else
CopyAFolder = -1
''''End if
End Function
''''目录进行移动
Function MoveAFolder(SourcePath,DestinationPath)
''''//功能:源目录存在时目的目录不存在时才能对目录进行移动
''''//形参:源目录,目的目录
''''//返回值:成功为1,失败为-1
''''//
If ReportFolderStatus(SourcePath)=1 And ReportFolderStatus(DestinationPath)=0
Then
fso.MoveFolder SourcePath, DestinationPath
MoveAFolder = 1
Else
MoveAFolder = -1
End if
End Function
''''判断目录是否存在
''''Response.Write ReportFolderStatus("G:\soft\delphi\my_pro\")
Function ReportFolderStatus(fldr)
''''//功能:判断目录是否存在
''''//形参:目录
''''//返回值:成功为1,失败为-1
''''//
Dim msg
msg = -1
If (fso.FolderExists(fldr)) Then
msg = 1
Else
msg = -1
End If
ReportFolderStatus = msg
End Function
''''目录创建时信息
Function ShowFolderAccessInfo(FolderName,InfoType)
''''//功能:显示目录创建时信息
''''//形参:目录名,信息类别
''''// 1 -----创建时间
''''// 2 -----上次访问时间
''''// 3 -----上次修改时间
''''// 4 -----目录路径
''''// 5 -----目录名称
''''// 6 -----目录类型
''''// 7 -----目录大小
''''// 8 -----父目录
''''// 9 -----根目录
''''//返回值:成功为目录创建时信息,失败:-1
''''//
Dim f, s
If ReportFolderStatus(FolderName) = 1 then
Set f = fso.GetFolder(FolderName)
select Case InfoType
Case 1 s = f.Datecreated ''''// 1 -----
创建时间
Case 2 s = f.DateLastAccessed ''''// 2 -----上次访问
时间
Case 3 s = f.DateLastModified ''''// 3 -----上次修改
时间
Case 4 s = f.Path ''''// 4
-----文件路径
Case 5 s = f.Name ''''// 5
-----文件名称
Case 6 s = f.Type ''''// 6
-----文件类型
Case 7 s = f.Size ''''// 7
-----文件大小
Case 8 s = f.ParentFolder ''''// 8 -----
父目录
Case 9 s = f.RootFolder ''''// 9 -----
根目录
End select
ShowFolderAccessInfo = s
ELse
ShowFolderAccessInfo = -1
End if
End Function
Function DisplayLevelDepth(pathspec)
Dim f, n ,Path
Set f = fso.GetFolder(pathspec)
If f.IsRootFolder Then
DisplayLevelDepth ="指定的文件夹是根文件夹。"&RootFolder
Else
Do Until f.IsRootFolder
Path = Path & f.Name &"<br>"
Set f = f.ParentFolder
n = n + 1
Loop
DisplayLevelDepth ="指定的文件夹是嵌套级为 " & n & &q