?
This document uses PHP Chinese website manual Release
JScript? | 語(yǔ)言參考 |
根據(jù)指定路徑返回包含驅(qū)動(dòng)器名稱(chēng)的字符串。
object.GetDriveName(path)
object
必選項(xiàng)。 應(yīng)為 FileSystemObject 的名稱(chēng)。
path
必選項(xiàng)。 路徑說(shuō)明,將根據(jù)其中成分返回驅(qū)動(dòng)器名稱(chēng)。
如果無(wú)法確定驅(qū)動(dòng)器,GetDriveName 方法將返回長(zhǎng)度為零的字符串 ("") 。
注意?? GetDriveName 只作用于所提供的 path 字符串。 不會(huì)試圖解析路徑,也不會(huì)檢查指定的路徑是否存在。
下面的例子說(shuō)明了 GetDriveName 方法的用法。
function GetDriveLetter(path) {
???var fso, s ="";
???fso = new ActiveXObject("Scripting.FileSystemObject");
???s += fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(path)));
???return(s);
}
GetAbsolutePathName 方法 | GetBaseName 方法 | GetDrive 方法 | GetExtensionName 方法 | GetFile 方法 | GetFileName 方法 | GetFileVersion 方法 | GetFolder 方法 | GetParentFolderName 方法 | GetSpecialFolder 方法 | GetTempName 方法應(yīng)用于: FileSystemObject 對(duì)象