Computer - Spazio Libero HD




Dichiarazione della funzione API da inserire in un modulo Bas
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










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