Bonsoir,
dans mon application, après avoir inséré mon "if" (qui fonctionne) j'insère mon else qui lui ne fontionne pas.
J'ai tout de suite constaté que c'était du auque j'ai inséré !
Code : Sélectionner tout - Visualiser dans une fenêtre à part for (int i = 0; i < iFile.Length; i++)
Voici mon code :
Comment remédier à cela ?
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
20
21
22
23
24
25
26
27 private void buttonX1_Click(object sender, EventArgs e) { for (int i = 0; i < iFile.Length; i++) { if (File.Exists(iFile[i])) { MessageBox.Show("Un fichier a été trouvé", "Fichier trouvé", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1); } else { MessageBox.Show("Aucun fichier à imprimer", "Fichier introuvable", MessageBoxButtons.OK, MessageBoxIcon.Error); } } }
Partager