Private Declare Function GetVolumeInformation Lib "kernel32" Alias "GetVolumeInformationA" (ByVal lpRootPathName As String, ByVal lpVolumeNameBuffer As String, ByVal nVolumeNameSize As Long, lpVolumeSerialNumber As Long, lpMaximumComponentLength As Long, lpFileSystemFlags As Long, ByVal lpFileSystemNameBuffer As String, ByVal nFileSystemNameSize As Long) As Long
Private Declare Function GetDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" (ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector As Long, lpNumberOfFreeClusters As Long, lpTotalNumberOfClusters As Long) As Long
Private Const FS_CASE_IS_PRESERVED = &H2
Private Const FS_CASE_SENSITIVE = &H1
Private Const FS_UNICODE_STORED_ON_DISK = &H4
Private Const FS_PERSISTENT_ACLS = &H8
Private Const FS_FILE_COMPRESSION = &H10
Private Const FS_VOL_IS_COMPRESSED = &H8000
Private Sub Command1_Click()
Dim Volume As String, SysName As String
Dim SerialNum As Long, SysFlags As Long, ComponentLength As Long, Res As Long
Dim SectorsPerCluster As Long, BytesPerSector As Long, NumberOfFreeClustors As Long, TotalNumberOfClustors As Long
Dim FreeBytes As Long, TotalBytes As Double, PercentFree As Long, Dl As Long
Volume = String(256, 0)
SysName = String(256, 0)
Dim DrvName As String
DrvName = "c:\"
Res = GetVolumeInformation(DrvName, Volume, 255, SerialNum, _
ComponentLength, SysFlags, SysName, 255)