'remember techgnome: you must ensure that this string has correct legt(it must be > or = to predicted string. Otherrvise this code will fail)
TextBox1.Text = "FE4M-I4D3-TD63-37S2; May 30,2010" & Environment.NewLine & "BF2O-YW18-V3Q2-N3T5; May 36,2010" & Environment.NewLine & "5OEN-I7N2-MIR2-NU2U; May 33,2010"
'create array of strings from above textbox. Do this by dividing it to let say 3 parts (divider is 'Environment.NewLine', result 0: "FE4M-I4D3-TD63-37S2; May 30,2010" , result 1: "BF2O-YW18-V3Q2-N3T5; May 36,2010" ...)
Dim arrStr() As String = Split(TextBox1.Text.ToString, Environment.NewLine)
'cut the right part off
arrStr(0) = arrStr(0).Substring(0, arrStr(0).LastIndexOf(";"))
arrStr(1) = arrStr(1).Substring(0, arrStr(1).LastIndexOf(";"))
arrStr(2) = arrStr(2).Substring(0, arrStr(2).LastIndexOf(";"))
'Like techgnome said you should really not save your original serial key like I have did in my sample inside a string.
'Correct serials writen inside simple text Strings (in real life this is bad to do)
Dim validSerial1 As String = "FE4M-I4D3-TD63-1"
Dim validSerial2 As String = "BF2O-YW18-V3Q2-N3T5" 'only this one will match
Dim validSerial3 As String = "5OEN-I7N2-MIR2-3"
'test 3 serials against all 3 given serials
Dim corectKeys As Integer
If validSerial1 = arrStr(0) Or validSerial1 = arrStr(1) Or validSerial1 = arrStr(2) Then 'first serial is matched to one of serials from textBox
corectKeys += 1 'corectKeys = corectKeys + 1
ElseIf validSerial2 = arrStr(0) Or validSerial2 = arrStr(1) Or validSerial2 = arrStr(2) Then 'second serial is matched to one of serials from textBox
corectKeys += 1
ElseIf validSerial3 = arrStr(0) Or validSerial3 = arrStr(1) Or validSerial3 = arrStr(2) Then 'third serial is matched to one of serials from textBox
corectKeys += 1
Else 'no serial match
corectKeys = 0
End If
If corectKeys > 0 Then 'at least 1 key is corect key...
MsgBox("yup")
Else 'all keys are not working
MsgBox("no no no")
End If