<%
(%$$307#^67)心情家园www.bbsdiy.net Class Cls_FSO
(%$$307#^67)心情家园www.bbsdiy.net Public objFSO
(%$$307#^67)心情家园www.bbsdiy.net Private Sub Class_Initialize()
(%$$307#^67)心情家园www.bbsdiy.net Set objFSO = Server.CreateObject("s cripting.FileSystemObject")
(%$$307#^67)心情家园www.bbsdiy.net End Sub
(%$$307#^67)心情家园www.bbsdiy.net Private Sub class_terminate()
(%$$307#^67)心情家园www.bbsdiy.net Set objFSO = Nothing
(%$$307#^67)心情家园www.bbsdiy.net End Sub
(%$$307#^67)心情家园www.bbsdiy.net '=======文件操作========
(%$$307#^67)心情家园www.bbsdiy.net '取文件大小
(%$$307#^67)心情家园www.bbsdiy.net Public Function GetFileSize(FileName)
(%$$307#^67)心情家园www.bbsdiy.net Dim f
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileName) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.Getfile(FileName)
(%$$307#^67)心情家园www.bbsdiy.net GetFileSize = f.Size
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net GetFileSize = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '文件删除
(%$$307#^67)心情家园www.bbsdiy.net Public Function deleteAFile(FileSpec)
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileSpec) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net objFSO.deleteFile(FileSpec)
(%$$307#^67)心情家园www.bbsdiy.net deleteAFile = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net deleteAFile = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '显示文件列表
(%$$307#^67)心情家园www.bbsdiy.net Public Function ShowFileList(FolderSpec)
(%$$307#^67)心情家园www.bbsdiy.net Dim f, f1, fc, s
(%$$307#^67)心情家园www.bbsdiy.net If ReportFolderStatus(FolderSpec) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFolder(FolderSpec)
(%$$307#^67)心情家园www.bbsdiy.net Set fc = f.Files
(%$$307#^67)心情家园www.bbsdiy.net For Each f1 in fc
(%$$307#^67)心情家园www.bbsdiy.net s = s & f1.name
(%$$307#^67)心情家园www.bbsdiy.net s = s & "|"
(%$$307#^67)心情家园www.bbsdiy.net Next
(%$$307#^67)心情家园www.bbsdiy.net ShowFileList = s
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net ShowFileList = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '文件复制
(%$$307#^67)心情家园www.bbsdiy.net Public Function CopyAFile(SourceFile, DestinationFile)
(%$$307#^67)心情家园www.bbsdiy.net Dim MyFile
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(SourceFile) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set MyFile = objFSO.GetFile(SourceFile)
(%$$307#^67)心情家园www.bbsdiy.net MyFile.Copy (DestinationFile)
(%$$307#^67)心情家园www.bbsdiy.net CopyAFile = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net CopyAFile = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '文件移动
(%$$307#^67)心情家园www.bbsdiy.net Public Function MoveAFile(SourceFile,DestinationFile)
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(SourceFile) = 1 And ReportFileStatus(DestinationFileORPath) = -1 Then
(%$$307#^67)心情家园www.bbsdiy.net objFSO.MoveFile SourceFile,DestinationFileORPath
(%$$307#^67)心情家园www.bbsdiy.net MoveAFile = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net MoveAFile = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '文件是否存在?
(%$$307#^67)心情家园www.bbsdiy.net Public Function ReportFileStatus(FileName)
(%$$307#^67)心情家园www.bbsdiy.net Dim msg
(%$$307#^67)心情家园www.bbsdiy.net msg = -1
(%$$307#^67)心情家园www.bbsdiy.net If (objFSO.FileExists(FileName)) Then
(%$$307#^67)心情家园www.bbsdiy.net msg = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net msg = -1
(%$$307#^67)心情家园www.bbsdiy.net End If
(%$$307#^67)心情家园www.bbsdiy.net ReportFileStatus = msg
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '文件创建日期
(%$$307#^67)心情家园www.bbsdiy.net Public Function ShowDatecreated(FileSpec)
(%$$307#^67)心情家园www.bbsdiy.net Dim f
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileSpec) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFile(FileSpec)
(%$$307#^67)心情家园www.bbsdiy.net ShowDatecreated = f.Datecreated
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net ShowDatecreated = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '文件属性
(%$$307#^67)心情家园www.bbsdiy.net Public Function GetAttributes(FileName)
(%$$307#^67)心情家园www.bbsdiy.net Dim f
(%$$307#^67)心情家园www.bbsdiy.net Dim strFileAttributes
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileName) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFile(FileName)
(%$$307#^67)心情家园www.bbsdiy.net select Case f.attributes
(%$$307#^67)心情家园www.bbsdiy.net Case 0 strFileAttributes = "普通文件。没有设置任何属性。 "
(%$$307#^67)心情家园www.bbsdiy.net Case 1 strFileAttributes = "只读文件。可读写。 "
(%$$307#^67)心情家园www.bbsdiy.net Case 2 strFileAttributes = "隐藏文件。可读写。 "
(%$$307#^67)心情家园www.bbsdiy.net Case 4 strFileAttributes = "系统文件。可读写。 "
(%$$307#^67)心情家园www.bbsdiy.net Case 16 strFileAttributes = "文件夹或目录。只读。 "
(%$$307#^67)心情家园www.bbsdiy.net Case 32 strFileAttributes = "上次备份后已更改的文件。可读写。 "
(%$$307#^67)心情家园www.bbsdiy.net Case 1024 strFileAttributes = "链接或快捷方式。只读。 "
(%$$307#^67)心情家园www.bbsdiy.net Case 2048 strFileAttributes = " 压缩文件。只读。"
(%$$307#^67)心情家园www.bbsdiy.net End select
(%$$307#^67)心情家园www.bbsdiy.net GetAttributes = strFileAttributes
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net GetAttributes = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '最后一次访问/最后一次修改时间
(%$$307#^67)心情家园www.bbsdiy.net Public Function ShowFileAccessInfo(FileName,InfoType)
(%$$307#^67)心情家园www.bbsdiy.net '//功能:显示文件创建时信息
(%$$307#^67)心情家园www.bbsdiy.net '//形参:文件名,信息类别
(%$$307#^67)心情家园www.bbsdiy.net '// 1 -----创建时间
(%$$307#^67)心情家园www.bbsdiy.net '// 2 -----上次访问时间
(%$$307#^67)心情家园www.bbsdiy.net '// 3 -----上次修改时间
(%$$307#^67)心情家园www.bbsdiy.net '// 4 -----文件路径
(%$$307#^67)心情家园www.bbsdiy.net '// 5 -----文件名称
(%$$307#^67)心情家园www.bbsdiy.net '// 6 -----文件类型
(%$$307#^67)心情家园www.bbsdiy.net '// 7 -----文件大小
(%$$307#^67)心情家园www.bbsdiy.net '// 8 -----父目录
(%$$307#^67)心情家园www.bbsdiy.net '// 9 -----根目录
(%$$307#^67)心情家园www.bbsdiy.net Dim f, s
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileName) = 1 then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFile(FileName)
(%$$307#^67)心情家园www.bbsdiy.net select Case InfoType
(%$$307#^67)心情家园www.bbsdiy.net Case 1 s = f.Datecreated
(%$$307#^67)心情家园www.bbsdiy.net Case 2 s = f.DateLastAccessed
(%$$307#^67)心情家园www.bbsdiy.net Case 3 s = f.DateLastModified
(%$$307#^67)心情家园www.bbsdiy.net Case 4 s = f.Path
(%$$307#^67)心情家园www.bbsdiy.net Case 5 s = f.Name
(%$$307#^67)心情家园www.bbsdiy.net Case 6 s = f.Type
(%$$307#^67)心情家园www.bbsdiy.net Case 7 s = f.Size
(%$$307#^67)心情家园www.bbsdiy.net Case 8 s = f.ParentFolder
(%$$307#^67)心情家园www.bbsdiy.net Case 9 s = f.RootFolder
(%$$307#^67)心情家园www.bbsdiy.net End select
(%$$307#^67)心情家园www.bbsdiy.net ShowFileAccessInfo = s
(%$$307#^67)心情家园www.bbsdiy.net ELse
(%$$307#^67)心情家园www.bbsdiy.net ShowFileAccessInfo = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '写文本文件
(%$$307#^67)心情家园www.bbsdiy.net Public Function WriteTxtFile(FileName,TextStr,WriteORAppendType)
(%$$307#^67)心情家园www.bbsdiy.net Const ForReading = 1, ForWriting = 2 , ForAppending = 8
(%$$307#^67)心情家园www.bbsdiy.net Dim f, m
(%$$307#^67)心情家园www.bbsdiy.net select Case WriteORAppendType
(%$$307#^67)心情家园www.bbsdiy.net Case 1: '文件进行写操作
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.OpenTextFile(FileName, ForWriting, True)
(%$$307#^67)心情家园www.bbsdiy.net f.Write TextStr
(%$$307#^67)心情家园www.bbsdiy.net f.Close
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileName) = 1 then
(%$$307#^67)心情家园www.bbsdiy.net WriteTxtFile = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net WriteTxtFile = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net Case 2: '文件末尾进行写操作
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileName) = 1 then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.OpenTextFile(FileName, ForAppending)
(%$$307#^67)心情家园www.bbsdiy.net f.Write TextStr
(%$$307#^67)心情家园www.bbsdiy.net f.Close
(%$$307#^67)心情家园www.bbsdiy.net WriteTxtFile = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net WriteTxtFile = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End select
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '读文本文件
(%$$307#^67)心情家园www.bbsdiy.net Public Function ReadTxtFile(FileName)
(%$$307#^67)心情家园www.bbsdiy.net Const ForReading = 1, ForWriting = 2
(%$$307#^67)心情家园www.bbsdiy.net Dim f, m
(%$$307#^67)心情家园www.bbsdiy.net If ReportFileStatus(FileName) = 1 then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.OpenTextFile(FileName, ForReading)
(%$$307#^67)心情家园www.bbsdiy.net m = f.ReadLine
(%$$307#^67)心情家园www.bbsdiy.net ReadTxtFile = m
(%$$307#^67)心情家园www.bbsdiy.net f.Close
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net ReadTxtFile = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '建立文本文件
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '=======目录操作========
(%$$307#^67)心情家园www.bbsdiy.net '取目录大小
(%$$307#^67)心情家园www.bbsdiy.net Public Function GetFolderSize(FolderName)
(%$$307#^67)心情家园www.bbsdiy.net Dim f
(%$$307#^67)心情家园www.bbsdiy.net If ReportFolderStatus(FolderName) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFolder(FolderName)
(%$$307#^67)心情家园www.bbsdiy.net GetFolderSize = f.Size
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net GetFolderSize = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '创建的文件夹
(%$$307#^67)心情家园www.bbsdiy.net Public Function createFolderDemo(FolderName)
(%$$307#^67)心情家园www.bbsdiy.net Dim f
(%$$307#^67)心情家园www.bbsdiy.net If ReportFolderStatus(Folderspec) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net createFolderDemo = -1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.createFolder(FolderName)
(%$$307#^67)心情家园www.bbsdiy.net createFolderDemo = 1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '目录删除
(%$$307#^67)心情家园www.bbsdiy.net Public Function deleteAFolder(Folderspec)
(%$$307#^67)心情家园www.bbsdiy.net Response.write Folderspec
(%$$307#^67)心情家园www.bbsdiy.net If ReportFolderStatus(Folderspec) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net objFSO.deleteFolder (Folderspec)
(%$$307#^67)心情家园www.bbsdiy.net deleteAFolder = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net deleteAFolder = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '显示目录列表
(%$$307#^67)心情家园www.bbsdiy.net Public Function ShowFolderList(FolderSpec)
(%$$307#^67)心情家园www.bbsdiy.net Dim f, f1, fc, s
(%$$307#^67)心情家园www.bbsdiy.net If ReportFolderStatus(FolderSpec) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFolder(FolderSpec)
(%$$307#^67)心情家园www.bbsdiy.net Set fc = f.SubFolders
(%$$307#^67)心情家园www.bbsdiy.net For Each f1 in fc
(%$$307#^67)心情家园www.bbsdiy.net s = s & f1.name
(%$$307#^67)心情家园www.bbsdiy.net s = s & "|"
(%$$307#^67)心情家园www.bbsdiy.net Next
(%$$307#^67)心情家园www.bbsdiy.net ShowFolderList = s
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net ShowFolderList = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '目录复制
(%$$307#^67)心情家园www.bbsdiy.net Public Function CopyAFolder(SourceFolder,DestinationFolder)
(%$$307#^67)心情家园www.bbsdiy.net objFSO.CopyFolder SourceFolder,DestinationFolder
(%$$307#^67)心情家园www.bbsdiy.net CopyAFolder = 1
(%$$307#^67)心情家园www.bbsdiy.net CopyAFolder = -1
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '目录进行移动
(%$$307#^67)心情家园www.bbsdiy.net Public Function MoveAFolder(SourcePath,DestinationPath)
(%$$307#^67)心情家园www.bbsdiy.net If ReportFolderStatus(SourcePath)=1 And ReportFolderStatus(DestinationPath)=0 Then
(%$$307#^67)心情家园www.bbsdiy.net objFSO.MoveFolder SourcePath, DestinationPath
(%$$307#^67)心情家园www.bbsdiy.net MoveAFolder = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net MoveAFolder = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '判断目录是否存在
(%$$307#^67)心情家园www.bbsdiy.net Public Function ReportFolderStatus(fldr)
(%$$307#^67)心情家园www.bbsdiy.net Dim msg
(%$$307#^67)心情家园www.bbsdiy.net msg = -1
(%$$307#^67)心情家园www.bbsdiy.net If (objFSO.FolderExists(fldr)) Then
(%$$307#^67)心情家园www.bbsdiy.net msg = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net msg = -1
(%$$307#^67)心情家园www.bbsdiy.net End If
(%$$307#^67)心情家园www.bbsdiy.net ReportFolderStatus = msg
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '目录创建时信息
(%$$307#^67)心情家园www.bbsdiy.net Public Function ShowFolderAccessInfo(FolderName,InfoType)
(%$$307#^67)心情家园www.bbsdiy.net '//功能:显示目录创建时信息
(%$$307#^67)心情家园www.bbsdiy.net '//形参:目录名,信息类别
(%$$307#^67)心情家园www.bbsdiy.net '// 1 -----创建时间
(%$$307#^67)心情家园www.bbsdiy.net '// 2 -----上次访问时间
(%$$307#^67)心情家园www.bbsdiy.net '// 3 -----上次修改时间
(%$$307#^67)心情家园www.bbsdiy.net '// 4 -----目录路径
(%$$307#^67)心情家园www.bbsdiy.net '// 5 -----目录名称
(%$$307#^67)心情家园www.bbsdiy.net '// 6 -----目录类型
(%$$307#^67)心情家园www.bbsdiy.net '// 7 -----目录大小
(%$$307#^67)心情家园www.bbsdiy.net '// 8 -----父目录
(%$$307#^67)心情家园www.bbsdiy.net '// 9 -----根目录
(%$$307#^67)心情家园www.bbsdiy.net Dim f, s
(%$$307#^67)心情家园www.bbsdiy.net If ReportFolderStatus(FolderName) = 1 then
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFolder(FolderName)
(%$$307#^67)心情家园www.bbsdiy.net select Case InfoType
(%$$307#^67)心情家园www.bbsdiy.net Case 1 s = f.Datecreated
(%$$307#^67)心情家园www.bbsdiy.net Case 2 s = f.DateLastAccessed
(%$$307#^67)心情家园www.bbsdiy.net Case 3 s = f.DateLastModified
(%$$307#^67)心情家园www.bbsdiy.net Case 4 s = f.Path
(%$$307#^67)心情家园www.bbsdiy.net Case 5 s = f.Name
(%$$307#^67)心情家园www.bbsdiy.net Case 6 s = f.Type
(%$$307#^67)心情家园www.bbsdiy.net Case 7 s = f.Size
(%$$307#^67)心情家园www.bbsdiy.net Case 8 s = f.ParentFolder
(%$$307#^67)心情家园www.bbsdiy.net Case 9 s = f.RootFolder
(%$$307#^67)心情家园www.bbsdiy.net End select
(%$$307#^67)心情家园www.bbsdiy.net ShowFolderAccessInfo = s
(%$$307#^67)心情家园www.bbsdiy.net ELse
(%$$307#^67)心情家园www.bbsdiy.net ShowFolderAccessInfo = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '遍历目录
(%$$307#^67)心情家园www.bbsdiy.net Public Function DisplayLevelDepth(pathspec)
(%$$307#^67)心情家园www.bbsdiy.net Dim f, n ,Path
(%$$307#^67)心情家园www.bbsdiy.net Set f = objFSO.GetFolder(pathspec)
(%$$307#^67)心情家园www.bbsdiy.net If f.IsRootFolder Then
(%$$307#^67)心情家园www.bbsdiy.net DisplayLevelDepth ="指定的文件夹是根文件夹。"&RootFolder
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net Do Until f.IsRootFolder
(%$$307#^67)心情家园www.bbsdiy.net Path = Path & f.Name &"<br>"
(%$$307#^67)心情家园www.bbsdiy.net Set f = f.ParentFolder
(%$$307#^67)心情家园www.bbsdiy.net n = n + 1
(%$$307#^67)心情家园www.bbsdiy.net Loop
(%$$307#^67)心情家园www.bbsdiy.net DisplayLevelDepth ="指定的文件夹是嵌套级为 " & n & " 的文件夹。<br>" & Path
(%$$307#^67)心情家园www.bbsdiy.net End If
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '========磁盘操作========
(%$$307#^67)心情家园www.bbsdiy.net '驱动器是否存在?
(%$$307#^67)心情家园www.bbsdiy.net Public Function ReportDriveStatus(drv)
(%$$307#^67)心情家园www.bbsdiy.net Dim msg
(%$$307#^67)心情家园www.bbsdiy.net msg = -1
(%$$307#^67)心情家园www.bbsdiy.net If objFSO.DriveExists(drv) Then
(%$$307#^67)心情家园www.bbsdiy.net msg = 1
(%$$307#^67)心情家园www.bbsdiy.net Else
(%$$307#^67)心情家园www.bbsdiy.net msg = -1
(%$$307#^67)心情家园www.bbsdiy.net End If
(%$$307#^67)心情家园www.bbsdiy.net ReportDriveStatus = msg
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net
(%$$307#^67)心情家园www.bbsdiy.net '可用的返回类型包括 FAT、NTFS 和 CDFS。
(%$$307#^67)心情家园www.bbsdiy.net Public Function ShowFileSystemType(drvspec)
(%$$307#^67)心情家园www.bbsdiy.net Dim d
(%$$307#^67)心情家园www.bbsdiy.net If ReportDriveStatus(drvspec) = 1 Then
(%$$307#^67)心情家园www.bbsdiy.net Set d = objFSO.GetDrive(drvspec)
(%$$307#^67)心情家园www.bbsdiy.net ShowFileSystemType = d.FileSystem
(%$$307#^67)心情家园www.bbsdiy.net ELse
(%$$307#^67)心情家园www.bbsdiy.net ShowFileSystemType = -1
(%$$307#^67)心情家园www.bbsdiy.net End if
(%$$307#^67)心情家园www.bbsdiy.net End Function
(%$$307#^67)心情家园www.bbsdiy.net End Class
(%$$307#^67)心情家园www.bbsdiy.net %>
(%$$307#^67)心情家园www.bbsdiy.net
|