DiskSpace Function (String) | |
Return the capacity of the specified disk.
Namespace:
XSharp.Core
Assembly:
XSharp.Core (in XSharp.Core.dll) Version: 2.21
Syntax FUNCTION DiskSpace(
cDrive AS STRING
) AS INT64
public static long DiskSpace(
string cDrive
)
Request Example
View SourceParameters
- cDrive
- Type: String
The name of the drive as a string, for example "C:", "A:". If you do not specify a drive, the Windows default is used.
Return Value
Type:
Int64
The capacity of the specified disk drive in bytes.
Remarks
DiskSpace() determines the capacity of the specified disk drive in bytes.
This function is only accurate for disk drives up to 2 gigabytes in size.
For larger drives, please refer to the GetDiskFreeSpaceEx() Windows API function.
Examples
This example displays the capacity of the C drive in a TextBox:
1TextBox{, "C Drive Capacity", AsString( DiskSpace(3) ) }:Show()
2TextBox{, "C Drive Capacity", AsString( DiskSpace("C:") ) }:Show()
See Also