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