DriveInfo::IsReady Property
.NET Framework (current version)
Gets a value that indicates whether a drive is ready.
Assembly: mscorlib (in mscorlib.dll)
IsReady indicates whether a drive is ready. For example, it indicates whether a CD is in a CD drive or whether a removable storage device is ready for read/write operations. If you do not test whether a drive is ready, and it is not ready, querying the drive using DriveInfo will raise an IOException.
Do not rely on IsReady to avoid catching exceptions from other members such as TotalSize, TotalFreeSpace, and DriveFormat. Between the time that your code checks IsReady and then accesses one of the other properties (even if the access occurs immediately after the check), a drive may have been disconnected or a disk may have been removed.
.NET Framework
Available since 2.0
Available since 2.0
Show: