Dim intSectors, intBytes, intFreeC, intTotalC, intTotal ,intFreeb
' include this windows api
extern.Declare micLong, "GetDiskFreeSpace", "kernel32.dll", "GetDiskFreeSpaceA", micString+micByref, micLong+micByref, micLong+micByref,micLong+micByref,micLong+micByref
' set these values
intSectors = 255
intBytes = 255
intFreeC = 255
intTotalC = 255
' calculate the disk space, using C: in this example
intSpaceAvailable = extern.GetDiskFreeSpace("c:\", intSectors, intBytes, intFreeC, intTotalC)
' calculate the totals
intTotal = intTotalC * intSectors * intBytes
intFreeb = intFreeC * intSectors * intBytes
' show the outputs
msgBox intSectors
msgBox intBytes
msgBox intFreeC
msgBox intTotalC
msgbox intTotal
msgBox intFreeb
No comments:
Post a Comment