?
This document uses PHP Chinese website manual Release
JScript? | 語(yǔ)言參考 |
如果指定的驅(qū)動(dòng)器存在則返回 True ;如果不存在則返回 False 。
object.DriveExists(drivespec)
object
必選項(xiàng)。 應(yīng)為 FileSystemObject 的名稱。
drivespec
必選項(xiàng)。 驅(qū)動(dòng)器號(hào)或完整的路徑說(shuō)明。
對(duì)于可移動(dòng)媒體的驅(qū)動(dòng)器, 即使沒(méi)有媒體 DriveExists 方法也返回 true 。 可以使用 Drive 對(duì)象的 IsReady 屬性來(lái)決定驅(qū)動(dòng)器是否就緒。
下面的例子說(shuō)明了 DriveExists 方法的用法。
function ReportDriveStatus(drv) {
???var fso, s = "";
???fso = new ActiveXObject("Scripting.FileSystemObject");
???if (fso.DriveExists(drv))
??????s += "Drive " + drv + " exists.";
???else
??????s += "Drive " + drv + " doesn't exist.";
???return(s);
}
Drive Object | Drives Collection | FileExists 方法 | FolderExists 方法 | GetDrive 方法 | GetDriveName 方法 | IsReady 屬性應(yīng)用于: FileSystemObject 對(duì)象