Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DriveInfo::AvailableFreeSpace Property

 

Indicates the amount of available free space on a drive, in bytes.

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

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

Property Value

Type: System::Int64

The amount of free space available on the drive, in bytes.

Exception Condition
UnauthorizedAccessException

Access to the drive information is denied.

IOException

An I/O error occurred (for example, a disk error or a drive was not ready).

This property indicates the amount of free space available on the drive. Note that this number may be different from the TotalFreeSpace number because this property takes into account disk quotas.

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:
© 2017 Microsoft