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 LongConst FILE_VOLUME_IS_COMPRESSED = &H8000Public Sub GetVolInfo(Byval Path as String)Dim aa As LongDim VolName As StringDim fsysName As StringDim path As StringDim VolSeri As Long, compress As LongDim Sysflag As Long, Maxlen As LongVolName = String(255, 0)fsysName = String(255, 0)aa = GetVolumeInformation(path, VolName, 256, VolSeri, Maxlen, _ Sysflag, fsysName, 256)VolName = Left(VolName, InStr(1, VolName, Chr(0)) - 1)fsysName = Left(fsysName, InStr(1, fsysName, Chr(0)) - 1)compress = Sysflag And FILE_VOLUME_IS_COMPRESSEDIf compress = 0 Then Debug.Print "非Compress之Volume"Else Debug.Print "Compress之Volume"End IfDebug.Print "Volume Name :", VolNameDebug.Print "Volume Serical# : ", Hex(VolSeri)Debug.Print "Name of the file system (such as FAT, HPFS, or NTFS)", fsysNameDebug.Print "Max Length of File Name ", MaxlenEnd SubPrivate Sub Command1_Click() Call GetVolInfo("c:")End sub(本文来源于图老师网站,更多请访问http://m.tulaoshi.com/bianchengyuyan/)