I have for a few weeks try'ed to make a keygen. I have a working code, but i think that it looks waaay to complicated. Can you please come with examples on how to do it in an easy'er way?
Public Class Form1
Function generate()
beg:0
Dim serial(5) As String
Dim snothing(5) As Single
Do
Randomize()
serial(1) = Int(Rnd() * 10)
serial(3) = Int(Rnd() * 10)
snothing(1) = serial(1)
snothing(3) = serial(3)
Loop Until (snothing(1) + 5 + (snothing(3) * 2) = "28")
Do
Randomize()
serial(2) = Int(Rnd() * 10)
serial(5) = Int(Rnd() * 10)
snothing(2) = serial(2)
snothing(5) = serial(5)
Loop Until (snothing(2) + snothing(5) + 4 = "14")
Do
Randomize()
serial(4) = Int(Rnd() * 10)
snothing(4) = serial(4)
Loop Until (snothing(4) * 2 = "12")
Dim s As String
s = (snothing(1) & snothing(2) & snothing(3) & snothing(4) & snothing(5))
Return s
End Function
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
TextBox1.Text = generate()
End Sub
End Class

New Topic/Question
Reply



MultiQuote




|