今天给大家分享的是由图老师小编精心为您推荐的取得Disk Free Space与Total Space,喜欢的朋友可以分享一下,也算是给小编一份支持,大家都不容易啊!
【 tulaoshi.com - 编程语言 】
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'Path = "c:" 指定Volume 代号, 如: c: d: e:Public Function GetFreeSpace(Byval Path as String) as LongDim aa As LongDim Path As StringDim SecPerClust As LongDim BytePerSec As Long, FreeClust As Long, totClust As LongPath = "c:" '指定Volume 代号, 如: c: d: e:aa = GetDiskFreeSpace(Path, SecPerClust, BytePerSec, FreeClust, totClust)GetFreeSpace = SecPerClust * BytePerSec * FreeClustEnd Function'Path = "c:" 指定Volume 代号, 如: c: d: e:Public Function GetTotalSpace(Byval Path as String) as LongDim aa As LongDim Path As StringDim SecPerClust As LongDim BytePerSec As Long, FreeClust As Long, totClust As Longaa = GetDiskFreeSpace(Path, SecPerClust, BytePerSec, FreeClust, totClust)GetTotalSpace = SecPerClust * BytePerSec * totClustEnd Function(本文来源于图老师网站,更多请访问http://www.tulaoshi.com/bianchengyuyan/)
来源:http://www.tulaoshi.com/n/20160219/1613369.html
看过《取得Disk Free Space与Total Space》的人还看了以下文章 更多>>