Bonjour,
comment je peux faire pour afficher l'espace disque
sur ma form "A propos" dans un appli VB 2005
j'ai le code suivant mais incompatible avec ma form
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 For Each CurrentDrive As DriveInfo In DriveInfo.GetDrives ' Vérification qu'on a bien affaire à un disque dur de l'ordinateur If CurrentDrive.DriveType = DriveType.Fixed Then ' Calcul du pourcentage d'espace disque libre Dim pourcentageLibre As Double = (CType(CurrentDrive.AvailableFreeSpace, Double) / CurrentDrive.TotalSize) * 100 Console.WriteLine("Espace libre de {0} >> {1}%", CurrentDrive.Name, Convert.ToInt16(pourcentageLibre)) End If Next
Cordialement,
Partager