根據指定路徑中的最后成分返回包含其父文件夾名稱的字符串。
object.GetParentFolderName(path)
object
必選項。 應為 FileSystemObject 的名稱。
path
必選項。 路徑說明,將根據其中成分返回其父文件夾的名稱。
假如 path 參數中指定的成分沒有父文件夾,那么 GetParentFolderName 方法將返回長度為零的字符串 ("") 。
注重 GetParentFolderName 方法只作用于所提供的 path 字符串。 不會試圖解析路徑,也不會檢查指定的路徑存在與否。
下面的例子說明了 GetParentFolderName 方法的用法。
function ShowParentFolderName(filespec){var fso, s = "";fso = new ActiveXObject("Scrs += fso.GetParentFolderName(filespec);return(s);}
GetAbsolutePathName 方法 GetBaseName 方法 GetDrive 方法 GetDriveName 方法 GetExtensionName 方法 GetFile 方法 GetFileName 方法 GetFileVersion 方法 GetFolder 方法 GetSpecialFolder 方法 GetTempName 方法應用于: FileSystemObject 對象
新聞熱點
疑難解答