Results 1 to 6 of 6

Thread: Register a program

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Ontario, Canada
    Posts
    61
    Hello

    I would like my program to be able to be registered but the code has to match or it won't register

    I want the thing to be like

    if Len(code) = 16 then
    code = ucase(code)
    DoCheckcode code
    Else
    MsgBox "invalid code", vbExclamation, "ERROR!"
    end if

    sub Docheckcode(code as String)
    If left(code, 1) = A then
    goto check2
    else
    goto badcode
    end if

    check2:
    if left(code) = anynumber then
    goto check3
    else
    goto badcode

    check3:
    if left(code) = B then
    goto check4
    else
    goto badcode
    end if
    end sub

    and so on

    but where it says any number I want the program to see if its a number

    my question is how can I make my program go to bad code if its a number greater then nine or not a number at all

    I hope you can understand my question
    ---~^ Absalom ^~---

    There is nobody in the world who knows everything there is no one his/her workforce who knows everything what really makes the person smart is that he/she is not affraid to ask for help.

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I'm a little confused by your checking routine, by the looks of it you are checking that the fist character is an A and then check that the first character is a number (which is silly because you've just made sure it's an A.

    I'd get rid of the goto statements as well. (they are considered evil by the VB comunity) I'd have a function to check the code, if one of the tests fails return false and Exit Function, if it gets to the end return true.

    but apart from that I think the function you are looking for is the IsNumeric function

    Code:
     
    MsgBox IsNumeric("Hello")
    MsgBox IsNumeric("123")
    will message False then True, basicly if the string is a number it returns true.

  3. #3
    Guest
    I would also recomend removing the message box saying the code is wrong,
    because I read on this forum, that if a "hacker" knows what point to look in the program for the code-checking algo. it is easy to dissasemble and crack it....

    so I think it would be better to check if the code is write in the Text1_Change and if it is, then enable the "next" button or whatever.

  4. #4
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    In an issue of PC Plus ages ago, there was an article on making self-registering, self-changing apps with VB4. If anyone has back issues that far (it will be 1998/97, I think), then could they have a go?

    As for me...I have no idea.
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  5. #5

    Thread Starter
    Member
    Join Date
    Jul 2000
    Location
    Ontario, Canada
    Posts
    61
    Ok well does any one have any registration algorithms
    ---~^ Absalom ^~---

    There is nobody in the world who knows everything there is no one his/her workforce who knows everything what really makes the person smart is that he/she is not affraid to ask for help.

  6. #6
    Guest
    I dont but ActiveLock does.
    its a free royalty-free OCX that you can use for registering programs and stuff....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width