System.IO.DriveInfo.IsReady Property

Gets a value that indicates whether a drive is ready.

Syntax

public bool IsReady { get; }

Value

Documentation for this section has not yet been entered.

Remarks

DriveInfo.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 System.IO.DriveInfo will raise an System.IO.IOException.

Do not rely on DriveInfo.IsReady to avoid catching exceptions from other members such as DriveInfo.TotalSize, DriveInfo.TotalFreeSpace, and DriveInfo.DriveFormat. Between the time that your code checks DriveInfo.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.

Requirements

Namespace: System.IO
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0