Jump to content

help with a licence key genor for my own programes


Recommended Posts

hello all,

im making a script for me to use on my own programs than i code.

i have made a app that randomly gens a set of letters and number BUT i want my app to allways generate thae same set of numbers and letters, the reson i want to do this is so i can give my main program that im making to a company to try for 14 days and then need to buy the licence code off me for each pc in there company.

once the fixed sequnce is done on this gen app ill put it into my own progeam afterwards to do check to see if the code matches.

but anyway here is my gen app that i need help with.

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1_1 = GUICreate("Form1", 302, 271, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 32, 104, 233, 145, BitOR($ES_WANTRETURN,$WS_VSCROLL,$WS_BORDER))
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("Run", 72, 40, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

dim $letters

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        case $Button1
            GUICtrlSetData($Edit1,"")
            _KEY_GEN_LIST()

    EndSwitch
WEnd

Func _KEY_GEN_LIST()
$GENLIST = 0
    Do
        $i = 0
            Do
                $Part1 = Chr(Random(Asc("a"), Asc("z"), 1))
                $Part1_1 = $Part1
                $i = $i + 1
                GUICtrlSetData($Edit1,$Part1_1,1)
            Until $i = 8
            GUICtrlSetData($Edit1,"-",1)
            $i2 = 0
            Do
                $number = Random(0,9,1)
                $numbers = $number
                $i2 = $i2 + 1
                GUICtrlSetData($Edit1,$numbers,1)
            Until $i2 = 5
                GUICtrlSetData($Edit1,"-",1)
            $i3 = 0
            Do
                $Part2 = Chr(Random(Asc("a"), Asc("z"), 1))
                $Part2_2 = $Part2
                $i3 = $i3 + 1
                GUICtrlSetData($Edit1,$Part2_2,1)
            Until $i3 = 8

        $GENLIST = $GENLIST + 1
        GUICtrlSetData($Edit1,@CRLF,1)
    until $GENLIST = 50
EndFunc

thanks all.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...