I have a binary file loaded into a byte array (which might need to be converted to a string). I am trying to enter a value in Txtbx2 and search the array, when found return the offset where it was found. Is there a way I can alter the code below to work or is there another way?
Code:
Dim [Data] As Byte() = New Byte() {1, 2, 4, 6, 3}
Dim find As Byte = TextBox2.Text
Dim index As Integer = System.Array.IndexOf(Of Byte)([Data], find)
If (index = -1) Then
MessageBox.Show("Not Found")
'Not found...
Else
'Found
TextBox3.Text = index
End If
Comment