IsReady 属性返回指定驱动器是否就绪。就绪为 true,未就绪为 false。
注释:对于可移动媒体驱动器和 CD-ROM 驱动器,仅当插入相应的媒体并准备接受访问时,IsReady 返回 True。
DriveObject.IsReady
<%
dim fs,d,n
set fs=Server.CreateObject("Scripting.FileSystemObject")
set d=fs.GetDrive("a:")
n = "The " & d.DriveLetter
if d.IsReady
=true then
n=n & " drive is ready!"
else
n=n & " drive is not ready!"
end if
Response.Write(n)
set d=nothing
set fs=nothing
%>
输出:
The A drive is not ready!