Here's a couple of other approaches similar to what you already have.

If data.IndexOf(Name) > 0 AndAlso data.IndexOf(pass) > 0 Then
accountok()
Else
accountbad()
End If


p = data.IndexOf(Name)
If p > 0 AndAlso data.Substring(p + Name.Length + 1, pass.Length) = pass Then
accountok
else
accountbad
End If