今天天气好晴朗处处好风光,好天气好开始,图老师又来和大家分享啦。下面给大家推荐取得Disk Volume Information,希望大家看完后也有个好心情,快快行动吧!
【 tulaoshi.com - 编程语言 】
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://www.tulaoshi.com/bianchengyuyan/)
来源:http://www.tulaoshi.com/n/20160219/1613310.html
看过《取得Disk Volume Information》的人还看了以下文章 更多>>