Bonjour,
j'enregistre un fichier et après je veux lire ce fichier et mettre ce qu'il contient dans une combobox mais il me dit qu'il ne trouve pas le fichier, voici le 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
20 If My.Computer.FileSystem.FileExists(".\" & ComboBox1.Text & ".txt") Then Else Dim sw As New StreamWriter(".\" & ComboBox1.Text & ".txt") End If 'Process.Start(".\" & ComboBox1.Text & ".txt") ComboBox2.Items.Clear() Dim SR3 As New StreamReader(".\" & ComboBox1.Text & ".txt") Do Until SR3.Peek = -1 Dim Ligne2 As String Ligne2 = SR3.ReadLine() Me.ComboBox2.Items.Add(Ligne2) Loop ComboBox2.Sorted = True If ComboBox2.Items.Count > 0 Then Me.ComboBox2.SelectedIndex = 0 Else ComboBox2.Text = "" End If SR3.Close()
Partager