IsReady 屬性
如果指定的驅(qū)動(dòng)器就緒,返回 True;否則返回 False。
object.IsReady
object 應(yīng)為 Drive 對(duì)象的名稱。
說明
對(duì)于可移動(dòng)媒體驅(qū)動(dòng)器和 CD-ROM 驅(qū)動(dòng)器,僅當(dāng)插入相應(yīng)的媒體并準(zhǔn)備接受訪問時(shí),IsReady 返回 True。
以下代碼舉例說明如何使用 IsReady 屬性:
Function ShowDriveInfo(drvpath) Dim fso, d, s, t Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(drvpath) Select Case d.DriveType Case 0: t = "
未知"
Case 1: t = "
可移動(dòng)"
Case 2: t = "
固定"
Case 3: t = "
網(wǎng)絡(luò)"
Case 4: t = "CD-ROM"
Case 5: t = "RAM
磁盤"
End Select
s = "
驅(qū)動(dòng)器 " d.DriveLetter ": - " t
If d.IsReady Then
s = s "BR>" "
驅(qū)動(dòng)器已就緒。"
Else
s = s "BR>" "
驅(qū)動(dòng)器未就緒。"
End If
ShowDriveInfo = s
End Function