se recomienda usar el método String.Compare. Usando ese método también puede controlar si hacer que realice comparaciones con mayúsculas y minúsculas o no.
muestra:
Dim str1 As String = "String one"
Dim str2 As String = str1
Dim str3 As String = "String three"
Dim str4 As String = str3
If String.Compare(str1, str2) = 0 And String.Compare(str3, str4) = 0 Then
MessageBox.Show("str1 = str2 And str3 = str4")
Else
MessageBox.Show("Else")
End If
Editar: si desea realizar una búsqueda sensible a las mayúsculas se puede utilizar el parámetro StringComparison:
If String.Compare(str1, str2, StringComparison.InvariantCultureIgnoreCase) = 0 And String.Compare(str3, str4, StringComparison.InvariantCultureIgnoreCase) = 0 Then
¿Es este "clásico" vb o vb.net? –
el que está en visual web developer 2008. vb.net asumo –