GetParentFolderName 方法 |
|
GetParentFolderName 方法的语法有以下部分:
部分 | 描述 |
object | 必选。应为 FileSystemObject 的名称。 |
path | 必选。指定路径,要返回文件或文件夹的父文件夹名。 |
下面例子举例说明如何使用 GetParentFolderName 方法:
Function GetTheParent(DriveSpec) Dim fso Set fso = CreateObject("Scripting.FileSystemObject") GetTheParent = fso.GetParentFolderName(Drivespec) End Function
注意 GetParentFolderName 方法仅应用于提供的 path 字符串。该方法不会辨识路径,也不检测路径是否存在。 | |