Private list1 As New List(Of String)
Private Function GetLineNumber(searchingword As String) As Integer
For row As Integer = 0 To list1.Count - 1
If list1(row).Contains(searchingword) Then
Return row
End If
Next
Return -1
End Function
'à placer dans le event load de ta form
list1 = IO.File.ReadAllLines("the path of the file").ToList
dim line as integer
line = GetLineNumber("journal")
Private list1 As New List(Of String)
Private Function GetLineNumber(searchingword As String) As Integer
For row As Integer = 0 To list1.Count - 1
If list1(row).Contains(searchingword) Then
Return row
End If
Next
Return -1
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'à placer dans le event load de ta form
list1 = IO.File.ReadAllLines("C:\MYDIR\compteur.txt").ToList
Dim line As Integer
line = GetLineNumber("financer")
Richtextbox1.Text = line
End Sub
Private Function GetLineContent(searchingword As String) As string
For row As Integer = 0 To list1.Count - 1
If list1(row).Contains(searchingword) Then
Return list1(row)
End If
Next
Return string.empty
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
'à placer dans le event load de ta form
list1 = IO.File.ReadAllLines("C:\MYDIR\compteur.txt").ToList
Dim line As string
line = GetLineContent("financer")
if line <> string.empty then
Richtextbox1.Text = line
end if
End Sub
Private list1 As New List(Of String)
Private Function GetLineContent(searchingword As String) As String
For row As Integer = 0 To list1.Count - 1
If list1(row).Contains(searchingword) Then
Return list1(row)
End If
Next
Return String.Empty
End Function
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
'à placer dans le event load de ta form
list1 = IO.File.ReadAllLines("C:\MYDIR\compteur.txt").ToList
Dim line As String
line = GetLineContent(TextBox1.text)
If line <> String.Empty Then
RichTextBox1.Text = line
End If
End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question