Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
Private Sub Command1_Click()
Dim a, b, c, d, free, total As Long
Dim disk As String
disk = Text1.Text
GetDiskFreeSpace disk, a, b, c, d
total = d * b * a / 1024 / 1024
free = c * a * b / 1024 / 1024
Label4.Caption = total & "MB"
Label5.Caption = free & "MB"
End Sub