calculate free space

Xlobby plugin development

calculate free space

Postby jumpman23 on Sun Nov 05, 2006 2:23 pm

Hello, I use xlobby for to send files into usb. But I would like to know the free space with xscript for example. I find the codes on the net but I don' t know to adapt for xlobby. Anybody help me please, thanks

Public Shared Function DirectorySize(ByVal dirInfo As System.IO.DirectoryInfo) As Long
Dim total As Long = 0
For Each Fichier As System.IO.FileInfo In dirInfo.GetFiles()
total += Fichier.Length
Next
For Each Dossier As System.IO.DirectoryInfo In dirInfo.GetDirectories()
total += DirectorySize(Dossier)
Next
Return total
End Function


' Exemple d'utilisation
Dim TailleDeMonDossier As Long = DirectorySize(New System.IO.DirectoryInfo("C:\Windows\"))
jumpman23
 
Posts: 12
Joined: Sat Feb 11, 2006 12:25 am

Postby ptrinchi on Thu Nov 09, 2006 2:25 pm

ptrinchi
 
Posts: 108
Joined: Fri Sep 10, 2004 8:52 pm
Location: France