PHP كود :
Public Class Form1
Dim allLines() As String
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim openfile1 = New OpenFileDialog()
openfile1.Filter = "Text (*.txt)|*.txt"
If (openfile1.ShowDialog() = System.Windows.Forms.DialogResult.OK) Then
patch.Text = openfile1.FileName
allLines = IO.File.ReadAllLines(patch.Text)
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
tbox_line.Text = "0"
For i = 0 To allLines.Count - 1
If allLines(i).Contains(tbox_Search.Text.Trim) Then
tbox_line.Text = i + 1
Exit For
End If
Next
If tbox_line.Text = "0" Then
MsgBox("الكلمة غير مدرجة في النص ")
End If
End Sub
End Class
