Bonjour,
j'ais réussi a lire mon fichier texte sans problème avec la routine suivante:
a l'écran j'ais bien ce que je veut :
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 Private Sub LireLeFichierToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LireLeFichierToolStripMenuItem.Click Try Dim sReader As StreamReader = New StreamReader(Application.StartupPath & "\Texte.txt") Dim sLine As String RichTextBox1.Text = "..... Debut du fichier ...." sLine = sReader.ReadLine() While Not sLine Is Nothing RichTextBox1.Text = RichTextBox1.Text & vbCrLf & sLine sLine = sReader.ReadLine() End While RichTextBox1.Text = RichTextBox1.Text & vbCrLf & ".... Fin du fichier ...." Catch ex As Exception MsgBox(ex.ToString) End Try
seulement je voudrais lire des lignes précises
ou une ligne sur deux *ou sur 3*
et je ne vois pas comment faire ....
Partager