Support Forums
[TuT] How to create a Simple Keygen? - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Visual Basic and the .NET Framework (https://www.supportforums.net/forumdisplay.php?fid=19)
+---- Thread: [TuT] How to create a Simple Keygen? (/showthread.php?tid=24441)



[TuT] How to create a Simple Keygen? - Jinu - 01-09-2012

[TuT] How to create a Simple Keygen?




Description:

Code:
For Generate

Dim Key As Integer
Key = Int( Rnd() * 6)
Select case Key
Case 1
Text Box 1. Text = " 858-787-767-809"
Case 2
Text Box 1. Text = " 158-787-767-809"
Case 3
Text Box 1. Text = " 558-787-767-809"
Case 4
Text Box 1. Text = " 358-787-767-809"
Case 5
Text Box 1. Text = " 658-787-767-809"
Case 6
Text Box 1. Text = " 758-787-767-809"


For Exit

End




RE: [TuT] How to create a Simple Keygen? - AceInfinity - 01-09-2012

Why is your code so jumbled up? And also you don't end your case statement.


Although i'm confused as to why you're making it even that difficult. Try something like this:
Code:
Public KeyA() As String = {"key1", "key2", "key3", "key4", "key5"}

    Private Shared Function ReturnKey(ByVal InputArray() As String, ByVal LastKeyIndex As Integer)
        Dim Key As New Random
        Return InputArray(Key.Next(0, LastKeyIndex))
    End Function

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        MsgBox(ReturnKey(KeyA, 4))
    End Sub



RE: [TuT] How to create a Simple Keygen? - Jinu - 01-09-2012

Thanks for the suggestion dude.


RE: [TuT] How to create a Simple Keygen? - Techie. - 01-10-2012

You should also have posted a text one.

But it is done. Big Grin


RE: [TuT] How to create a Simple Keygen? - AceInfinity - 01-10-2012

(01-10-2012, 07:25 AM)Techie. Wrote: You should also have posted a text one.

But it is done. Big Grin

A text one? It is already in text, you create the keys and put them in manually though.


RE: [TuT] How to create a Simple Keygen? - AlbinoShadow - 01-10-2012

Hmm... Interesting source code. Thanks for the contribution.


RE: [TuT] How to create a Simple Keygen? - OnyxDev - 05-15-2012

This is very helpful, especially to new users. Good job!