bonjour
Ce programme me permet d'afficher des informations sur un lecteur.
Par contre avec ce programme je vois que les informations du derniers lecteur j'aimerai pouvoir le choisir ( ex: A:\ ou C:\) comment faire?
J'utilise la classe System.IO
code:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 private void button1_Click(object sender, EventArgs e) { {DriveInfo[] Drives = DriveInfo.GetDrives(); foreach (DriveInfo a in Drives) { textBox1.Text = a.Name ; if (a.IsReady == true) { textBox2.Text = a.VolumeLabel; textBox3.Text = Convert.ToString(a.TotalSize); textBox4.Text = Convert.ToString(a.TotalFreeSpace); textBox5.Text = a.DriveFormat; } } }
Merci d'avance.
Partager