SpaceDisk




Private Declare Function apiDiskFreeSpace Lib "kernel32" Alias "GetDiskFreeSpaceA" _
(ByVal lpRootPathName As String, lpSectorsPerCluster As Long, lpBytesPerSector _
As Long, lpNumberOfFreeClusters As Long, lpTtoalNumberOfClusters As Long) As Long
'Semplice implementazione Dim TotalClusters As Long

Dim FreeClusters As Long
Dim SectorsPerCluster As Long
Dim BytesPerSector As Long
If apiDiskFreeSpace("C:\", SectorsPerCluster, BytesPerSector, FreeClusters, TotalClusters) Then
lngTotalSpace = SectorsPerCluster * BytesPerSector * TotalClusters
lngFreeSpace = SectorsPerCluster * BytesPerSector * FreeClusters
else
msgbox "Errore"
end if
Come sapere la quantita di spazio rimasto libero su di un disco
fisso, o la dimensione del medesimo, semplice, nel SDK di
win95/NT e stata definita una nuova funzione apiDiskFreeSpace.
Per utilizzare questa funzione occorre porre la dichiarazione
in un modulo BAS










( spacedisk.html )- by Paolo Puglisi - Modifica del 17/12/2023