DriveInfo::TotalSize Property

 

Gets the total size of storage space on a drive, in bytes.

Namespace:   System.IO
Assembly:  mscorlib (in mscorlib.dll)

public:
property long long TotalSize {
	long long get();
}

Property Value

Type: System::Int64

The total size of the drive, in bytes.

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.

The following code example demonstrates the use of the DriveInfo class to display information about all of the drives on the current system.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: