Hello community, so this is my problem, I have 4 TextBoxes and 1 "serial number". What I want is:
When the user pastes the serial number into the first TextBox, the String will be divided into 4 digits for each text box, thus leaving 16 digits in all, however, 4 in each TextBox.
And finally, I wanted a way to check the 4 text boxes to see if the text in them matches the text inside the String "Serial", all of this when clicking on the OK button (Button1_Click). The problem is that I have no idea how to do this, could someone help me with this?
When the user pastes the serial number into the first TextBox, the String will be divided into 4 digits for each text box, thus leaving 16 digits in all, however, 4 in each TextBox.
And finally, I wanted a way to check the 4 text boxes to see if the text in them matches the text inside the String "Serial", all of this when clicking on the OK button (Button1_Click). The problem is that I have no idea how to do this, could someone help me with this?
VB.NET:
Function Validacao(serial As String)
Dim Serial(15) As String
Serial(0) = "E8V7-J3MK-K3D4-D255"
For i = 0 To Serial.Count() - 1 Step 1
If serial = Serial(i) Then
Return True
End If
Next
Return False
End Function
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
If Validacao(TextBox1.Text) = True Then
MsgBox("Example Software is activated.", MsgBoxStyle.Information, "Congratulations!")
My.Settings.SaveSettings = True
My.Settings.Save()
My.Settings.Reload()
Dim dirSavePoint As New IO.DirectoryInfo("C:\ProgramData\SavePoint")
If Not dirSavePoint.Exists Then
My.Computer.FileSystem.CreateDirectory("C:\ProgramData\SavePoint")
End If
escreveINI("C:\ProgramData\SavePoint\Serial.INI", "Settings", "Serial", TextBox1.Text)
Form3.Show()
Me.Hide()
Else
MsgBox("Error! Your serial number is invalid.", MsgBoxStyle.Critical, "Error!")
End If
End Sub
End Class