03-20-2011, 11:42 AM
(This post was last modified: 03-20-2011, 11:42 AM by Resistance.)
Hey guys... Today I am going to show you how to generate random strings. You may call this a Keygen, but an amateur version.
Start off with 2 buttons and a textbox.
Button1 Code [Generate]:
Button2 Code [Copy Text]:
Results Should Look like This:
Enjoy and don't forget to say thanks if you liked my tutorial.
Start off with 2 buttons and a textbox.
Button1 Code [Generate]:
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Key As Integer
Key = Int(Rnd() * 5) 'The number 5 is replaced with the Maximum number of cases you have created.
Select Key
Case 0
TextBox1.Text = "John Ronder"
Case 1
TextBox1.Text = "Mary Hudkins"
Case 2
TextBox1.Text = "Jessy Gonvolio"
Case 3
TextBox1.Text = "Emily Jansen"
Case 4
TextBox1.Text = "Josh Federton"
Case 5
TextBox1.Text = "Sean Richman"
End Select
End Sub
Button2 Code [Copy Text]:
Code:
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Try
Clipboard.SetText(TextBox1.Text)
Catch ex As Exception
MsgBox("Please Generate a name", 16, "Error")
End Try
End Sub
Results Should Look like This:
Enjoy and don't forget to say thanks if you liked my tutorial.