|
-
Jun 12th, 2001, 12:58 PM
#1
Thread Starter
New Member
Free Disk space bigger than 2 GB
Hi all,
How can I know the free disk space on a drive when this quantity is bigger than 2 GB!?
The GetDiskFreeSpace API is limited to 2 GB.
Any suggestion? I work with VB6 under Win 98.
Thanx in advanced.
Javier R.
-
Jun 12th, 2001, 01:20 PM
#2
Frenzied Member
i dont think there's anything you could do, maybe get total disk size and subract use space
-
Jun 12th, 2001, 02:03 PM
#3
Frenzied Member
For over 2GB disks use the GetDiskFreeSpaceEx API Function:
VB Code:
Create a new project, and add this code to Form1:
Private Declare Function GetDiskFreeSpaceEx Lib "kernel32" Alias "GetDiskFreeSpaceExA" (ByVal lpRootPathName As String, lpFreeBytesAvailableToCaller As Currency, lpTotalNumberOfBytes As Currency, lpTotalNumberOfFreeBytes As Currency) As Long
Private Sub Form_Load()
Dim r As Long, BytesFreeToCalller As Currency, TotalBytes As Currency
Dim TotalFreeBytes As Currency, TotalBytesUsed As Currency
'the drive to find
Const RootPathName = "C:\"
'get the drive's disk parameters
Call GetDiskFreeSpaceEx(RootPathName, BytesFreeToCalller, TotalBytes, TotalFreeBytes)
'show the results, multiplying the returned
'value by 10000 to adjust for the 4 decimal
'places that the currency data type returns.
Me.AutoRedraw = True
Me.Cls
Me.Print
Me.Print " Total Number Of Bytes:", Format$(TotalBytes * 10000, "###,###,###,##0") & " bytes"
Me.Print " Total Free Bytes:", Format$(TotalFreeBytes * 10000, "###,###,###,##0") & " bytes"
Me.Print " Free Bytes Available:", Format$(BytesFreeToCalller * 10000, "###,###,###,##0") & " bytes"
Me.Print " Total Space Used :", Format$((TotalBytes - TotalFreeBytes) * 10000, "###,###,###,##0") & " bytes"
End Sub
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|