Visual Basic Scripting Edition | 語言參考 |
如果指定的文件夾是根文件夾,返回 True;否則返回 False。
object.IsRootFolder
object 應(yīng)為 Folder 對象的名稱。
以下代碼舉例說明如何使用 IsRootFolder 屬性:
Function DisplayLevelDepth(pathspec) Dim fso, f, n Set fso = CreateObject("Scripting.FileSystemObject") Set f = fso.GetFolder(pathspec) If f.IsRootFolder Then DisplayLevelDepth ="
指定的文件夾是根文件夾。"
Else
Do Until f.IsRootFolder
Set f = f.ParentFolder
n = n + 1
Loop
DisplayLevelDepth ="
指定的文件夾是嵌套級為" & n & "
的文件夾。"
End If
End Function
Attributes 屬性 | DateCreated 屬性 | DateLastAccessed 屬性 | DateLastModified 屬性 | Drive 屬性 | Files 屬性 | Name 屬性 | ParentFolder 屬性 | Path 屬性 | ShortName 屬性 | ShortPath 屬性 | Size 屬性 | SubFolders 屬性 | Type 屬性
應(yīng)用于:Folder 對象