A class that uses fso, also mentioned in the previous article. Here are some examples.
<%
Dim MyFileFolder
Set MyFileFolder = New FileFolderCls
'' ("f:\123\","f:\123\")
'' ("f:\456","f:\ditg\456")
'' ("i:\")
'' ("f:\123\","f:\123\")
''!!!!
'' ("f:\123\","f:\789\")
'' ("f:\ditg")
'' ("f:\123\123")
'' ("f:\123\")
'' ("f:\456\")
'' ("f:\147\")
'' ("f:\123\")
'' ("f:\123\")
'' ("f:\123\",1)&"<br>"
'' ("f:\123\",2)&"<br>"
'' ("f:\123\",3)&"<br>"
'' ("f:\123\",4)&"<br>"
'' ("f:\123\",5)&"<br>"
'' ("f:\123\",6)&"<br>"
'' ("f:\123\",7)&"<br>"
'' ("f:\123\",8)&"<br>"
'' ("f:\123\",1)&"<br>"
'' ("f:\123\",2)&"<br>"
'' ("f:\123\",3)&"<br>"
'' ("f:\123\",4)&"<br>"
'' ("f:\123\",5)&"<br>"
'' ("f:\123\",6)&"<br>"
'' ("f:\123\",7)&"<br>"
'' ("f:\123\",8)&"<br>"
'' ("f:\123\","",1)&"<br>"
'' ("f:\123\","cexowxfdw",1)&"<br>"
'' ("f:\123\",Chr(13)&Chr(10)
&"cexowxfdw",2)&"<br>"
'' ("f:\123\")&"<br>"
("F:\ditg\ditg\bumen\images")&"<br>"
Class FileFolderCls
Public fso
Private Sub Class_Initialize()
Set fso = CreateObject("")
End Sub
Private Sub Class_Terminate()
Set fso = Nothing
End Sub
''//=======================================================================================
''Take the file size
Function GetFileSize(FileName)
''//Function: Get file size
''//Formal parameter: file name
''//Return value: Success is file size, failure is -1
''//
Dim f
If ReportFileStatus(FileName) = 1 Then
Set f = (FileName)
GetFileSize =
Else
GetFileSize = -1
End if
End Function
''File Delete
Function DeleteAFile(filespec)
''//Function: File Delete
''//Formal parameter: file name
''//Return value: 1 for success, -1 for failure
''//
If ReportFileStatus(filespec) = 1 Then
(filespec)
DeleteAFile = 1
Else
DeleteAFile = -1
End if
End Function
''Show file list
Function ShowFileList(folderspec)
''//Function: When the directory exists, all files in this directory are displayed.
''//Formal parameters: directory name
''//Return value: Success is file list, failure is -1
''//
Dim f, f1, fc, s
If ReportFolderStatus(folderspec) = 1 Then
Set f = (folderspec)
Set fc =
For Each f1 in fc
s = s &
s = s & "|"
Next
ShowFileList = s
Else
ShowFileList = -1
End if
End Function
''!!!
''File Copy
Function CopyAFile(SourceFile,DestinationFile)
''//Function: The file can only be copied when the source file exists, and the destination file has no effect.
''//Formal parameters: source file, destination file
''//Return value: 1 for success, -1 for failure
''//
Dim MyFile
If ReportFileStatus(SourceFile) = 1 Then
Set MyFile = (SourceFile)
(DestinationFile)
CopyAFile = 1
Else
CopyAFile = -1
End if
End Function
''File Move
'' MoveAFile("f:\123\","f:\123\")
Function MoveAFile(SourceFile,DestinationFile)
''//Function: Only when the source file exists can the file be moved when the destination file does not exist.
''//Formal parameters: source file, destination file
''//Return value: 1 for success, -1 for failure
''//
If ReportFileStatus(SourceFile)=1 And ReportFileStatus(DestinationFileORPath) =
-1 Then
SourceFile,DestinationFileORPath
MoveAFile = 1
Else
MoveAFile = -1
End if
End Function
''Does the file exist?
'' ReportFileStatus("G: oft\delphi\my_pro\code library.exe")
Function ReportFileStatus(FileName)
''//Function: determine whether the file exists
''//Formal parameter: file name
''//Return value: 1 for success, -1 for failure
''//
Dim msg
msg = -1
If ((FileName)) Then
msg = 1
Else
msg = -1
End If
ReportFileStatus = msg
End Function
''File creation date
'' ShowDateCreated("G: oft\delphi\my_pro\code library.exe")
'' ShowDateCreated("G: oft\delphi\my_pro\Copy Copy Code .exe")
Function ShowDateCreated(filespec)
''//Function: File creation date
''//Formal parameter: file name
''//Return value: Success: File creation date, failed: -1
''//
Dim f
If ReportFileStatus(filespec) = 1 Then
Set f = (filespec)
ShowDateCreated =
Else
ShowDateCreated = -1
End if
End Function
''File Properties
'' GetAttributes("G: oft\delphi\my_pro\Copy Copy Codebase.exe")
Function GetAttributes(FileName)
''//Function: Display file attributes
''//Formal parameter: file name
''//Return value: Success: File attribute, failed: -1
''//
Dim f,Str
If ReportFileStatus(FileName) = 1 Then
Set f = (FileName)
Select Case
Case 0 Str="Normal file. No properties are set. "
Case 1 Str="Read-only file. Read-writeable. "
Case 2 Str="Hidden file. Read and write. "
Case 4 Str="System file. Read and writeable. "
Case 16 Str="Folder or Directory. Read-only. "
Case 32 Str="Files that have been changed after the last backup. Read and writeable. "
Case 1024 Str="Link or Shortcut. Read-only. "
Case 2048 Str=" Compressed file. Read-only."
End Select
GetAttributes = Str
Else
GetAttributes = -1
End if
End Function
''Last access/last modification time
'' ShowFileAccessInfo("G: oft\delphi\my_pro\Copy Copy Code Base.exe")
Function ShowFileAccessInfo(FileName,InfoType)
''//Function: Display the information when the file is created
''//Formal parameters: file name, information category
''// 1 ----Creation time
''// 2 ----Last visit time
''// 3 ---Last modified time
''// 4 ----File Path
''// 5 ----File Name
''// 6 ----File Type
''// 7 ----File Size
''// 8 ------ Parent directory
''// 9 ----Root directory
''//Return value: Successfully created for file information, failed: -1
''//
Dim f, s
If ReportFileStatus(FileName) = 1 then
Set f = (FileName)
Select Case InfoType
Case 1 s = ''// 1 -----
Creation time
Case 2 s = ''// 2 ---Last visit
time
Case 3 s = ''// 3 ---Last modified
time
Case 4 s = ''// 4
-----File path
Case 5 s = ''// 5
-----File Name
Case 6 s = ''// 6
-----File Type
Case 7 s = ''// 7
----- File size
Case 8 s = ''// 8 -----
Parent directory
Case 9 s = ''// 8 -----
Root directory
End Select
ShowFileAccessInfo = s
ELse
ShowFileAccessInfo = -1
End if
End Function
''Write text file
Function WriteTxtFile(FileName,TextStr,WriteORAppendType)
Const ForReading = 1, ForWriting = 2 , ForAppending = 8
Dim f, m
Select Case WriteORAppendType
Case 1: ''Writing the file
Set f = (FileName, ForWriting, True)
TextStr
If ReportFileStatus(FileName) = 1 then
WriteTxtFile = 1
Else
WriteTxtFile = -1
End if
Case 2: ''Write operation at the end of the file
If ReportFileStatus(FileName) = 1 then
Set f = (FileName, ForAppending)
TextStr
WriteTxtFile = 1
Else
WriteTxtFile = -1
End if
End Select
End Function
''Read text file
Function ReadTxtFile(FileName)
Const ForReading = 1, ForWriting = 2
Dim f, m
If ReportFileStatus(FileName) = 1 then
Set f = (FileName, ForReading)
m =
''m =
''
ReadTxtFile = m
Else
ReadTxtFile = -1
End if
End Function
''Create a text file
''//==========================================================================================
''Get the directory size
Function GetFolderSize(FolderName)
''//Function: Get the directory size
''//Formal parameters: directory name
''//Return value: Success is directory size, failure is -1
''//
Dim f
If ReportFolderStatus(FolderName) = 1 Then
Set f = (FolderName)
GetFolderSize =
Else
GetFolderSize = -1
End if
End Function
''Created folder
Function CreateFolderDemo(FolderName)
''//Function: Created folder
''//Formal parameters: directory name
''//Return value: 1 for success, -1 for failure
''//
Dim f
If ReportFolderStatus(Folderspec) = 1 Then
CreateFolderDemo = -1
Else
Set f = (FolderName)
CreateFolderDemo = 1
End if
End Function
''!!!
''Directory Delete
Function DeleteAFolder(Folderspec)
''//Function: Directory Delete
''//Formal parameters: directory name
''//Return value: 1 for success, -1 for failure
''//
Folderspec
If ReportFolderStatus(Folderspec) = 1 Then
(Folderspec)
DeleteAFolder = 1
Else
DeleteAFolder = -1
End if
End Function
''Show directory list
Function ShowFolderList(folderspec)
''//Function: When the directory exists, all subdirectories under this directory are displayed.
''//Formal parameters: directory name
''//Return value: Success is a subdirectory list, failure is -1
''//
Dim f, f1, fc, s
If ReportFolderStatus(folderspec) = 1 Then
Set f = (folderspec)
Set fc =
For Each f1 in fc
s = s &
s = s & "|"
Next
ShowFolderList = s
Else
ShowFolderList = -1
End if
End Function
''!!!!
''Catalog Copy
Function CopyAFolder(SourceFolder,DestinationFolder)
''//Function: The directory can only be copied when the source directory exists, and the destination directory has no effect.
''//Formal parameters: source directory, destination directory
''//Return value: 1 for success, -1 for failure
''//
''Dim MyFolder
''If ReportFolderStatus(SourceFolder) = 1 and ReportFolderStatus
(DestinationFolder) = -1 Then
''Set MyFolder = (SourceFolder)
SourceFolder,DestinationFolder
CopyAFolder = 1
''Else
CopyAFolder = -1
''End if
End Function
''Catalogs are moved
Function MoveAFolder(SourcePath,DestinationPath)
''//Function: The directory can only be moved when the source directory does not exist.
''//Formal parameters: source directory, destination directory
''//Return value: 1 for success, -1 for failure
''//
If ReportFolderStatus(SourcePath)=1 And ReportFolderStatus(DestinationPath)=0
Then
SourcePath, DestinationPath
MoveAFolder = 1
Else
MoveAFolder = -1
End if
End Function
''Just determine whether the directory exists
'' ReportFolderStatus("G: oft\delphi\my_pro\")
Function ReportFolderStatus(fldr)
''//Function: determine whether the directory exists
''//Formal parameters: Table of contents
''//Return value: 1 for success, -1 for failure
''//
Dim msg
msg = -1
If ((fldr)) Then
msg = 1
Else
msg = -1
End If
ReportFolderStatus = msg
End Function
''Information when directory creation
Function ShowFolderAccessInfo(FolderName,InfoType)
''//Function: Display information when directory creation
''//Formal parameters: directory name, information category
''// 1 ----Creation time
''// 2 ----Last visit time
''// 3 ---Last modified time
''// 4 ----Directory Path
''// 5 ---Catalogue Name
''// 6 ----Catalogue Type
''// 7 ----Directory Size
''// 8 ------ Parent directory
''// 9 ----Root directory
''//Return value: Successfully created for directory, failed: -1
''//
Dim f, s
If ReportFolderStatus(FolderName) = 1 then
Set f = (FolderName)
Select Case InfoType
Case 1 s = ''// 1 -----
Creation time
Case 2 s = ''// 2 ---Last visit
time
Case 3 s = ''// 3 ---Last modified
time
Case 4 s = ''// 4
-----File path
Case 5 s = ''// 5
-----File Name
Case 6 s = ''// 6
-----File Type
Case 7 s = ''// 7
----- File size
Case 8 s = ''// 8 -----
Parent directory
Case 9 s = ''// 9 -----
Root directory
End Select
ShowFolderAccessInfo = s
ELse
ShowFolderAccessInfo = -1
End if
End Function
Function DisplayLevelDepth(pathspec)
Dim f, n ,Path
Set f = (pathspec)
If Then
DisplayLevelDepth="The specified folder is the root folder."&RootFolder
Else
Do Until
Path = Path & &"<br>"
Set f =
n = n + 1
Loop
DisplayLevelDepth="The specified folder is a folder with a nested level of " & n & ".<br>"&
Path
End If
End Function
''//====================================================================================
''Does the drive exist?
'' ReportDriveStatus("C:\")
Function ReportDriveStatus(drv)
''//Function: Determine whether the disk exists
''//Modal parameters: disk
''//Return value: 1 for success, -1 for failure
''//
Dim msg
msg = -1
If (drv) Then
msg = 1
Else
msg = -1
End If
ReportDriveStatus = msg
End Function
''--------Available return types include FAT, NTFS, and CDFS.
'' ShowFileSystemType("C:\")
Function ShowFileSystemType(drvspec)
''//Function: Disk type
''//Formal parameter: disk name
''//Return value: Successful as types: FAT, NTFS and CDFS, failed: -1
''//
Dim d
If ReportDriveStatus(drvspec) = 1 Then
Set d = fso. GetDrive(drvspec)
ShowFileSystemType =
ELse
ShowFileSystemType = -1
End if
End Function
End Class
%>
<%
Dim MyFileFolder
Set MyFileFolder = New FileFolderCls
'' ("f:\123\","f:\123\")
'' ("f:\456","f:\ditg\456")
'' ("i:\")
'' ("f:\123\","f:\123\")
''!!!!
'' ("f:\123\","f:\789\")
'' ("f:\ditg")
'' ("f:\123\123")
'' ("f:\123\")
'' ("f:\456\")
'' ("f:\147\")
'' ("f:\123\")
'' ("f:\123\")
'' ("f:\123\",1)&"<br>"
'' ("f:\123\",2)&"<br>"
'' ("f:\123\",3)&"<br>"
'' ("f:\123\",4)&"<br>"
'' ("f:\123\",5)&"<br>"
'' ("f:\123\",6)&"<br>"
'' ("f:\123\",7)&"<br>"
'' ("f:\123\",8)&"<br>"
'' ("f:\123\",1)&"<br>"
'' ("f:\123\",2)&"<br>"
'' ("f:\123\",3)&"<br>"
'' ("f:\123\",4)&"<br>"
'' ("f:\123\",5)&"<br>"
'' ("f:\123\",6)&"<br>"
'' ("f:\123\",7)&"<br>"
'' ("f:\123\",8)&"<br>"
'' ("f:\123\","",1)&"<br>"
'' ("f:\123\","cexowxfdw",1)&"<br>"
'' ("f:\123\",Chr(13)&Chr(10)
&"cexowxfdw",2)&"<br>"
'' ("f:\123\")&"<br>"
("F:\ditg\ditg\bumen\images")&"<br>"
Class FileFolderCls
Public fso
Private Sub Class_Initialize()
Set fso = CreateObject("")
End Sub
Private Sub Class_Terminate()
Set fso = Nothing
End Sub
''//=======================================================================================
''Take the file size
Function GetFileSize(FileName)
''//Function: Get file size
''//Formal parameter: file name
''//Return value: Success is file size, failure is -1
''//
Dim f
If ReportFileStatus(FileName) = 1 Then
Set f = (FileName)
GetFileSize =
Else
GetFileSize = -1
End if
End Function
''File Delete
Function DeleteAFile(filespec)
''//Function: File Delete
''//Formal parameter: file name
''//Return value: 1 for success, -1 for failure
''//
If ReportFileStatus(filespec) = 1 Then
(filespec)
DeleteAFile = 1
Else
DeleteAFile = -1
End if
End Function
''Show file list
Function ShowFileList(folderspec)
''//Function: When the directory exists, all files in this directory are displayed.
''//Formal parameters: directory name
''//Return value: Success is file list, failure is -1
''//
Dim f, f1, fc, s
If ReportFolderStatus(folderspec) = 1 Then
Set f = (folderspec)
Set fc =
For Each f1 in fc
s = s &
s = s & "|"
Next
ShowFileList = s
Else
ShowFileList = -1
End if
End Function
''!!!
''File Copy
Function CopyAFile(SourceFile,DestinationFile)
''//Function: The file can only be copied when the source file exists, and the destination file has no effect.
''//Formal parameters: source file, destination file
''//Return value: 1 for success, -1 for failure
''//
Dim MyFile
If ReportFileStatus(SourceFile) = 1 Then
Set MyFile = (SourceFile)
(DestinationFile)
CopyAFile = 1
Else
CopyAFile = -1
End if
End Function
''File Move
'' MoveAFile("f:\123\","f:\123\")
Function MoveAFile(SourceFile,DestinationFile)
''//Function: Only when the source file exists can the file be moved when the destination file does not exist.
''//Formal parameters: source file, destination file
''//Return value: 1 for success, -1 for failure
''//
If ReportFileStatus(SourceFile)=1 And ReportFileStatus(DestinationFileORPath) =
-1 Then
SourceFile,DestinationFileORPath
MoveAFile = 1
Else
MoveAFile = -1
End if
End Function
''Does the file exist?
'' ReportFileStatus("G: oft\delphi\my_pro\code library.exe")
Function ReportFileStatus(FileName)
''//Function: determine whether the file exists
''//Formal parameter: file name
''//Return value: 1 for success, -1 for failure
''//
Dim msg
msg = -1
If ((FileName)) Then
msg = 1
Else
msg = -1
End If
ReportFileStatus = msg
End Function
''File creation date
'' ShowDateCreated("G: oft\delphi\my_pro\code library.exe")
'' ShowDateCreated("G: oft\delphi\my_pro\Copy Copy Code .exe")
Function ShowDateCreated(filespec)
''//Function: File creation date
''//Formal parameter: file name
''//Return value: Success: File creation date, failed: -1
''//
Dim f
If ReportFileStatus(filespec) = 1 Then
Set f = (filespec)
ShowDateCreated =
Else
ShowDateCreated = -1
End if
End Function
''File Properties
'' GetAttributes("G: oft\delphi\my_pro\Copy Copy Codebase.exe")
Function GetAttributes(FileName)
''//Function: Display file attributes
''//Formal parameter: file name
''//Return value: Success: File attribute, failed: -1
''//
Dim f,Str
If ReportFileStatus(FileName) = 1 Then
Set f = (FileName)
Select Case
Case 0 Str="Normal file. No properties are set. "
Case 1 Str="Read-only file. Read-writeable. "
Case 2 Str="Hidden file. Read and write. "
Case 4 Str="System file. Read and writeable. "
Case 16 Str="Folder or Directory. Read-only. "
Case 32 Str="Files that have been changed after the last backup. Read and writeable. "
Case 1024 Str="Link or Shortcut. Read-only. "
Case 2048 Str=" Compressed file. Read-only."
End Select
GetAttributes = Str
Else
GetAttributes = -1
End if
End Function
''Last access/last modification time
'' ShowFileAccessInfo("G: oft\delphi\my_pro\Copy Copy Code Base.exe")
Function ShowFileAccessInfo(FileName,InfoType)
''//Function: Display the information when the file is created
''//Formal parameters: file name, information category
''// 1 ----Creation time
''// 2 ----Last visit time
''// 3 ---Last modified time
''// 4 ----File Path
''// 5 ----File Name
''// 6 ----File Type
''// 7 ----File Size
''// 8 ------ Parent directory
''// 9 ----Root directory
''//Return value: Successfully created for file information, failed: -1
''//
Dim f, s
If ReportFileStatus(FileName) = 1 then
Set f = (FileName)
Select Case InfoType
Case 1 s = ''// 1 -----
Creation time
Case 2 s = ''// 2 ---Last visit
time
Case 3 s = ''// 3 ---Last modified
time
Case 4 s = ''// 4
-----File path
Case 5 s = ''// 5
-----File Name
Case 6 s = ''// 6
-----File Type
Case 7 s = ''// 7
----- File size
Case 8 s = ''// 8 -----
Parent directory
Case 9 s = ''// 8 -----
Root directory
End Select
ShowFileAccessInfo = s
ELse
ShowFileAccessInfo = -1
End if
End Function
''Write text file
Function WriteTxtFile(FileName,TextStr,WriteORAppendType)
Const ForReading = 1, ForWriting = 2 , ForAppending = 8
Dim f, m
Select Case WriteORAppendType
Case 1: ''Writing the file
Set f = (FileName, ForWriting, True)
TextStr
If ReportFileStatus(FileName) = 1 then
WriteTxtFile = 1
Else
WriteTxtFile = -1
End if
Case 2: ''Write operation at the end of the file
If ReportFileStatus(FileName) = 1 then
Set f = (FileName, ForAppending)
TextStr
WriteTxtFile = 1
Else
WriteTxtFile = -1
End if
End Select
End Function
''Read text file
Function ReadTxtFile(FileName)
Const ForReading = 1, ForWriting = 2
Dim f, m
If ReportFileStatus(FileName) = 1 then
Set f = (FileName, ForReading)
m =
''m =
''
ReadTxtFile = m
Else
ReadTxtFile = -1
End if
End Function
''Create a text file
''//==========================================================================================
''Get the directory size
Function GetFolderSize(FolderName)
''//Function: Get the directory size
''//Formal parameters: directory name
''//Return value: Success is directory size, failure is -1
''//
Dim f
If ReportFolderStatus(FolderName) = 1 Then
Set f = (FolderName)
GetFolderSize =
Else
GetFolderSize = -1
End if
End Function
''Created folder
Function CreateFolderDemo(FolderName)
''//Function: Created folder
''//Formal parameters: directory name
''//Return value: 1 for success, -1 for failure
''//
Dim f
If ReportFolderStatus(Folderspec) = 1 Then
CreateFolderDemo = -1
Else
Set f = (FolderName)
CreateFolderDemo = 1
End if
End Function
''!!!
''Directory Delete
Function DeleteAFolder(Folderspec)
''//Function: Directory Delete
''//Formal parameters: directory name
''//Return value: 1 for success, -1 for failure
''//
Folderspec
If ReportFolderStatus(Folderspec) = 1 Then
(Folderspec)
DeleteAFolder = 1
Else
DeleteAFolder = -1
End if
End Function
''Show directory list
Function ShowFolderList(folderspec)
''//Function: When the directory exists, all subdirectories under this directory are displayed.
''//Formal parameters: directory name
''//Return value: Success is a subdirectory list, failure is -1
''//
Dim f, f1, fc, s
If ReportFolderStatus(folderspec) = 1 Then
Set f = (folderspec)
Set fc =
For Each f1 in fc
s = s &
s = s & "|"
Next
ShowFolderList = s
Else
ShowFolderList = -1
End if
End Function
''!!!!
''Catalog Copy
Function CopyAFolder(SourceFolder,DestinationFolder)
''//Function: The directory can only be copied when the source directory exists, and the destination directory has no effect.
''//Formal parameters: source directory, destination directory
''//Return value: 1 for success, -1 for failure
''//
''Dim MyFolder
''If ReportFolderStatus(SourceFolder) = 1 and ReportFolderStatus
(DestinationFolder) = -1 Then
''Set MyFolder = (SourceFolder)
SourceFolder,DestinationFolder
CopyAFolder = 1
''Else
CopyAFolder = -1
''End if
End Function
''Catalogs are moved
Function MoveAFolder(SourcePath,DestinationPath)
''//Function: The directory can only be moved when the source directory does not exist.
''//Formal parameters: source directory, destination directory
''//Return value: 1 for success, -1 for failure
''//
If ReportFolderStatus(SourcePath)=1 And ReportFolderStatus(DestinationPath)=0
Then
SourcePath, DestinationPath
MoveAFolder = 1
Else
MoveAFolder = -1
End if
End Function
''Just determine whether the directory exists
'' ReportFolderStatus("G: oft\delphi\my_pro\")
Function ReportFolderStatus(fldr)
''//Function: determine whether the directory exists
''//Formal parameters: Table of contents
''//Return value: 1 for success, -1 for failure
''//
Dim msg
msg = -1
If ((fldr)) Then
msg = 1
Else
msg = -1
End If
ReportFolderStatus = msg
End Function
''Information when directory creation
Function ShowFolderAccessInfo(FolderName,InfoType)
''//Function: Display information when directory creation
''//Formal parameters: directory name, information category
''// 1 ----Creation time
''// 2 ----Last visit time
''// 3 ---Last modified time
''// 4 ----Directory Path
''// 5 ---Catalogue Name
''// 6 ----Catalogue Type
''// 7 ----Directory Size
''// 8 ------ Parent directory
''// 9 ----Root directory
''//Return value: Successfully created for directory, failed: -1
''//
Dim f, s
If ReportFolderStatus(FolderName) = 1 then
Set f = (FolderName)
Select Case InfoType
Case 1 s = ''// 1 -----
Creation time
Case 2 s = ''// 2 ---Last visit
time
Case 3 s = ''// 3 ---Last modified
time
Case 4 s = ''// 4
-----File path
Case 5 s = ''// 5
-----File Name
Case 6 s = ''// 6
-----File Type
Case 7 s = ''// 7
----- File size
Case 8 s = ''// 8 -----
Parent directory
Case 9 s = ''// 9 -----
Root directory
End Select
ShowFolderAccessInfo = s
ELse
ShowFolderAccessInfo = -1
End if
End Function
Function DisplayLevelDepth(pathspec)
Dim f, n ,Path
Set f = (pathspec)
If Then
DisplayLevelDepth="The specified folder is the root folder."&RootFolder
Else
Do Until
Path = Path & &"<br>"
Set f =
n = n + 1
Loop
DisplayLevelDepth="The specified folder is a folder with a nested level of " & n & ".<br>"&
Path
End If
End Function
''//====================================================================================
''Does the drive exist?
'' ReportDriveStatus("C:\")
Function ReportDriveStatus(drv)
''//Function: Determine whether the disk exists
''//Modal parameters: disk
''//Return value: 1 for success, -1 for failure
''//
Dim msg
msg = -1
If (drv) Then
msg = 1
Else
msg = -1
End If
ReportDriveStatus = msg
End Function
''--------Available return types include FAT, NTFS, and CDFS.
'' ShowFileSystemType("C:\")
Function ShowFileSystemType(drvspec)
''//Function: Disk type
''//Formal parameter: disk name
''//Return value: Successful as types: FAT, NTFS and CDFS, failed: -1
''//
Dim d
If ReportDriveStatus(drvspec) = 1 Then
Set d = fso. GetDrive(drvspec)
ShowFileSystemType =
ELse
ShowFileSystemType = -1
End if
End Function
End Class
%>