DriveInfo.TotalSize Property
.NET Framework (current version)
Gets the total size of storage space on a drive, in bytes.
Assembly: mscorlib (in mscorlib.dll)
| Exception | Condition |
|---|---|
| UnauthorizedAccessException | Access to the drive information is denied. |
| DriveNotFoundException | The drive is not mapped or does not exist. |
| IOException | An I/O error occurred (for example, a disk error or a drive was not ready). |
This property indicates the total size of the drive in bytes, not just what is available to the current user.
.NET Framework
Available since 2.0
Available since 2.0
Show: