Microsoft® Visual Basic® Scripting Edition TotalSize, propriété |
Référence de la bibliothèque d'exécution Scripting Version 3 |
Description
Renvoie l'espace total, en octets, d'un lecteur ou d'un partage réseau.
Syntaxe
object.TotalSizeL'argument object représente toujours un objet Drive.
Notes
Le code suivant illustre l'emploi de la propriété TotalSize :Function ShowSpaceInfo(drvpath) Dim fso, d, s Set fso = CreateObject("Scripting.FileSystemObject") Set d = fso.GetDrive(fso.GetDriveName(fso.GetAbsolutePathName(drvpath))) s = "Lecteur " & d.DriveLetter & ":" s = s & vbCrLf s = s & "Taille totale: " & FormatNumber(d.TotalSize/1024, 0) & " KOctets" s = s & vbCrLf s = s & "Disponible: " & FormatNumber(d.AvailableSpace/1024, 0) & " KOctets" ShowSpaceInfo = s End Function