Hallo an Alle,
Ich habe die API-Funktion „GetDiskFreeSpace („C:“, Sectors, Bytes, Freec, Totalc)“ gefunden, weiß aber nicht wie ich sie verwenden kann. (Bin API-Anfänger). Ich habe zwar jede menge VB-Scripte gefunden, aber da ich davon keine Anhnung habe hilft mir das nicht sonderlich weiter. Kann jemand von euch versuchen mir die Grundfunktionsweise näher zu bringen (Vielleicht im BASIC-Style )? Wäre echt toll.
Danke schonmal im Vorraus…
Hallo,
(Vielleicht im BASIC-Style
)?
da frage ich mich doch, warum Du das nicht im Brett VB fragst.
Option Explicit
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
Private Sub Form\_Load()
Dim Sectors As Long, Bytes As Long, FreeC As Long, TotalC As Long, Total As Double, Freeb As Long
GetDiskFreeSpace "C:\", Sectors, Bytes, FreeC, TotalC
List1.AddItem " Pfad: C:\"
List1.AddItem " Sektoren pro Cluster:" + Str$(Sectors)
List1.AddItem " Bytes pro Sektor:" + Str$(Bytes)
List1.AddItem " Anzahl freie Cluster:" + Str$(FreeC)
List1.AddItem " Cluster gesamt:" + Str$(TotalC)
Total = TotalC& \* Sectors& \* (Bytes& / 1024)
List1.AddItem " Anzehl K-Bytes im Pfad:" + Str$(Total)
Freeb = FreeC& \* Sectors& \* (Bytes& / 1024)
List1.AddItem " Freie K-Bytes:" + Str$(Freeb)
End Sub
Gruß, Rainer