Page 4 of 5 FirstFirst 12345 LastLast
Results 121 to 160 of 178

Thread: VB - A Program Registration Scheme

  1. #121
    Hyperactive Member
    Join Date
    May 2006
    Posts
    475

    Re: VB - A Program Registration Scheme

    Martin I am new to VB and I think i might be slow in understanding the VB concepts. I don't want to make assumptions, 1- When compiling my program should I include the Key generator program too? 2 - You mentioned that one should change the alogarythm in the project, this should be changed too what before compiling it?

    Hope you understand my sitauation.

    Thanks

  2. #122

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme

    Well since I have email I can't test the program with %100 confidence, but when an error occurrs in the RequestKey function because for example you don't have an email program, it displays frmRegError which contains the registration info. Have you run the program before? If so you may already be registered and so you won't get to that function. Check the registry and delete your former information and try it again.

  3. #123
    Hyperactive Member
    Join Date
    May 2006
    Posts
    475

    Re: VB - A Program Registration Scheme

    No, I have not yet run thr prog. I want to understand it b4 running it so that i don't make errors. Like i mentioned i need to know what and what exactly i should chage b4 running it

  4. #124

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme

    Quote Originally Posted by osemollie
    Martin I am new to VB and I think i might be slow in understanding the VB concepts. I don't want to make assumptions, 1- When compiling my program should I include the Key generator program too? 2 - You mentioned that one should change the alogarythm in the project, this should be changed too what before compiling it?

    Hope you understand my sitauation.

    Thanks
    Sorry, I missed this post of yours.

    1) No. That is just for you. After the user gets his information to you, you use that program to generate his key.

    2) I believe the formula in the two programs is now

    VB Code:
    1. strLicenseKey = CStr(Int(3456 * Sqr(lngSerialNum / 5)))

    That is just an arbitrary calculation and you could change it to anything you want such as any of the following. You don't actually have to change it at all, but if you don't then some knowledgeable user might stumble across the existing formula and be able to register without contacting you.

    VB Code:
    1. strLicenseKey = CStr(Int(666 * Sqr(lngSerialNum / 5)))
    2. strLicenseKey = CStr(Int(1234 * Sqr(lngSerialNum / 4)))
    3. strLicenseKey = CStr(Int(999 * Sqr(lngSerialNum / 3)))
    4. strLicenseKey = CStr(Int(2222 * Sqr(lngSerialNum / 5)))
    Just make sure you make the same change in both programs.

  5. #125

    Re: VB - A Program Registration Scheme

    Think I found why people were getting the error on string$ OLE Automation in project references is unchecked. If you recheck it everything works fine.

  6. #126
    Frenzied Member
    Join Date
    Jul 2004
    Posts
    1,202

    Re: VB - A Program Registration Scheme

    Can anyone implament a demo to this source code.?

  7. #127

  8. #128
    Addicted Member
    Join Date
    Dec 2006
    Location
    Georgia
    Posts
    170

    Re: VB - A Program Registration Scheme

    Would this routine still work under VS2005 .NET? And what kind of modifications would I need to make to make this work in the compact framework?

  9. #129

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme

    Quote Originally Posted by highflight1985
    Would this routine still work under VS2005 .NET? And what kind of modifications would I need to make to make this work in the compact framework?
    I assume that any code when propery converted to .Net would work, but I have no idea how you would do that since I don't do .Net.

  10. #130
    New Member Hashi Nara's Avatar
    Join Date
    Feb 2007
    Posts
    1

    Re: VB - A Program Registration Scheme

    Hello Martin,
    I stumbled across your site looking for just this application to use for MS Access applications I have written. I take note that your code is written for VB and not VBA and will be looking at suitable adjustments.

    I haven't at this time opened your project, but accept that it functions as you have described. I have read all of this thread and I am impressed with the way you have zeroed in on issues raised.

    The applications I have written are used on a LAN comprising some 50-100 workstations with the application residing on a central server. My question is: Will the program need to be registered only on the computer it is loaded on or on each computer it will run on?

  11. #131

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme


    First, I assume you'll have to make modifications to the program in order to run it in a VBA app. As to your question, as written the program assumes that it is installed on an individual's PC and so each user needs to register. The code is of course yours to do what you want with, so you can modify it as you see fit.

  12. #132
    Addicted Member adamm83's Avatar
    Join Date
    Oct 2005
    Location
    Toronto, ON, Canada
    Posts
    180

    Re: VB - A Program Registration Scheme

    Hi,
    this is a nice program. I have set up similar code a while ago with a program I made for a company for private use. It was a small company so it was easy to keep track of. What I did was I generated a serial using the following information:

    • HDD serial number
    • MAC Address
    • Processor ID
    • Windows Product ID


    I then concatenated the strings generated from the above items into one long string, and encrypted the string using a specific encryption (which, if you use this method is up to you). I used the encrypted string as a unique ID to generate the serial number.

    This may be thought of as excessive (and possibly redundant) but it helped protect unauthorized people from using the application. On top of that, once a serial number was generated for a specific computer it was added to a database controlled by myself of active serial numbers. Every time the user logged in to the program, it verified the computer's information with the serial number, then it contacts my "active serial" database to check if it's serial number is ok.

    If the serial number did not check out for whatever reason (i.e. changed hardware in computer) they are prompted to request a new serial number from me.

    Again, some of you may think this is extremely excessive and redundant... but I do not.

    One reason I did this was because I originally started out using ONLY the hdd serial number as a unique identifier like the project posted in this thread, but I quickly realized 2 things:

    1. The code I found for the HDD serial number did NOT return the HDD serial number, but rather the partition's volume number. This is a totally different thing. For example, if you have 2 partitions on a hdd, the code would return the volume id for a specified partition (i.e. C: drive)

    2. I found code that actually retrieved the HDD's serial number (the serial number that is put in by the manufacturer of the HDD). BUT for some reason, some computers returned the proper serial number from the manufacturer and some did not return anything at all. This posed a slight problem.

    Anyhow, thats was my solution. Enjoy!
    adamm
    ACM Designs

    Codebank:
    RegOpen - Open registry keys in Regedit quick & easily


    "A man who tries to catch two rabbits at the same time will catch neither."

  13. #133
    Frenzied Member
    Join Date
    Feb 2007
    Location
    Malaysia
    Posts
    1,370

    Re: VB - A Program Registration Scheme

    I can't download the code. Could some one help me?Here is my email astalavista_um@yahoo.com

  14. #134
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: VB - A Program Registration Scheme

    What happens when you try to download it? I just downloaded it a few minutes ago.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  15. #135

  16. #136
    Fanatic Member ksuwanto8ksd's Avatar
    Join Date
    Apr 2005
    Posts
    636

    Re: VB - A Program Registration Scheme

    Hi MartinLis,

    This is nice code.
    but I find a hardisk number is 2288776782
    and generate an error overflow

    thank for your code
    I really appreciate

    Kamus

  17. #137
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: VB - A Program Registration Scheme

    You would have to declare what ever variable it is as Double or Single but Double would be best

  18. #138

  19. #139
    Fanatic Member ksuwanto8ksd's Avatar
    Join Date
    Apr 2005
    Posts
    636

    Re: VB - A Program Registration Scheme

    Yes Martinlis I change it to double in both
    how about this one?

    Code:
    Public Function GetSerialNumber() As Long
    
        Dim strVolumeBuffer As String
        Dim strSysName As String
        Dim lngSerialNumber As Long
        Dim lngSysFlags As Long
        Dim lngComponentLen As Long
        Dim lngResult As Long
        
        strVolumeBuffer$ = VBA.String$(256, 0)
        strSysName$ = VBA.String$(256, 0)
        lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
                lngComponentLen, lngSysFlags, strSysName$, 255)
                     
        GetSerialNumber = lngSerialNumber
        
    End Function
    and this one
    Code:
    Public Function CalcRegKey(lngSerialNum As Long) As String
    
        Dim strLicenseKey As String
        Const ZEROS = "000000000"
        
        lngSerialNum = Abs(lngSerialNum)
        
        ' This calculation must be the same as the one used in GenKey
        strLicenseKey = CStr(Int(3456 * Sqr(Abs(lngSerialNum) / 5)))
        strLicenseKey = VBA.Left$(strLicenseKey, 9)
        If Len(strLicenseKey) < 9 Then
            strLicenseKey = VBA.Left$(ZEROS, 9 - Len(strLicenseKey)) & strLicenseKey
        End If
        
        CalcRegKey = strLicenseKey
    
    End Function
    thanks.
    I really appreciated

  20. #140

  21. #141
    Fanatic Member ksuwanto8ksd's Avatar
    Join Date
    Apr 2005
    Posts
    636

    Re: VB - A Program Registration Scheme

    In both I mean this from genkey
    Code:
    Public Sub Main()
    
        Dim strLicenseKey As String
        Dim lngSerialNum As Double
        Const ZEROS = "000000000"
        
        lngSerialNum = InputBox("Enter user's hard drive serial number")
        
        ' This calculation must be the same as the one used in your application
        strLicenseKey = CStr(Int(3456 * Sqr(lngSerialNum / 5)))
        strLicenseKey = Left$(strLicenseKey, 9)
        If Len(strLicenseKey) < 9 Then
            strLicenseKey = Left$(ZEROS, 9 - Len(strLicenseKey)) & strLicenseKey
        End If
        
        strLicenseKey = Format(strLicenseKey, "@@@-@@@-@@@")
        frmGenKey.txtKey = strLicenseKey
        frmGenKey.Show vbModal
    
    End Sub
    and this from protect
    Code:
    Public Function CalcRegKey(lngSerialNum As Long) As String
    
        Dim strLicenseKey As String
        Const ZEROS = "000000000"
        
        lngSerialNum = Abs(lngSerialNum)
        
        ' This calculation must be the same as the one used in GenKey
        strLicenseKey = CStr(Int(3456 * Sqr(Abs(lngSerialNum) / 5)))
        strLicenseKey = VBA.Left$(strLicenseKey, 9)
        If Len(strLicenseKey) < 9 Then
            strLicenseKey = VBA.Left$(ZEROS, 9 - Len(strLicenseKey)) & strLicenseKey
        End If
        
        CalcRegKey = strLicenseKey
    
    End Function
    how about this from protect

    Code:
    Public Function GetSerialNumber() As Long
    
        Dim strVolumeBuffer As String
        Dim strSysName As String
        Dim lngSerialNumber As Long
        Dim lngSysFlags As Long
        Dim lngComponentLen As Long
        Dim lngResult As Long
        
        strVolumeBuffer$ = VBA.String$(256, 0)
        strSysName$ = VBA.String$(256, 0)
        lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
                lngComponentLen, lngSysFlags, strSysName$, 255)
                     
        GetSerialNumber = lngSerialNumber
        
    End Function
    thanks for clarify
    very much appreciate.

  22. #142
    Interweb adm/o/distrator Paul M's Avatar
    Join Date
    Nov 2006
    Location
    Australia, Melbourne
    Posts
    2,306

    Re: VB - A Program Registration Scheme

    Yep there it

  23. #143

  24. #144

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme

    Quote Originally Posted by ksuwanto8ksd
    is it has to declare as double too?
    Code:
    Dim lngSerialNumber As Long
    thanks
    Wouldn't it be easy to try it and find out?

  25. #145
    Fanatic Member ksuwanto8ksd's Avatar
    Join Date
    Apr 2005
    Posts
    636

    Re: VB - A Program Registration Scheme

    I try this:
    Code:
    Public Function GetSerialNumber() As double
        Dim strVolumeBuffer As String
        Dim strSysName As String
        Dim lngSerialNumber As double
        Dim lngSysFlags As Long
        Dim lngComponentLen As Long
        Dim lngResult As Long
        
        strVolumeBuffer$ = VBA.String$(256, 0)
        strSysName$ = VBA.String$(256, 0)
        lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
                lngComponentLen, lngSysFlags, strSysName$, 255)
                     
        GetSerialNumber = lngSerialNumber
        
    End Function
    come with "compile error byref argument type mismatch"
    code marked italic.

    thanks.

  26. #146

  27. #147
    New Member
    Join Date
    May 2007
    Posts
    8

    Lightbulb Re: VB - A Program Registration Scheme

    Quote Originally Posted by MartinLiss
    Attached is a project (actually two projects) that show one way of having the user register his copy of your program. This is the way it works:

    • The main application displays a registration screen with two options: "Register" and "Request Registration Key".
    • If the user selects "Register" a new screen is shown that asks the user for his name and tells him that if he continues it will generate an e-mail message to you (via MAPI) and that you will send him the registration key by return e-mail. If he continues, the program gets his hard drive serial number and includes it in the e-mail to you.
    • Once you receive the registration request email, you use the second project (GenKey) to generate a registration key by way of a simple algorithm that you can change based on the hard drive serial number. Just remember that the algorithm is in both projects and it must be exactly the same in both.
    • You then send the registration key back to the user and have them enter it in the second part of the registration screen which writes the key to the registry.
    • When they start the main program again it uses the same algorithm to see if the registration key in the Registry matches the HD serial number. If it matches the program starts (see Notes below). If it doesn't match or if there is no registry entry, the program does not start or you could arrange it so that it starts with only a few demo functions available.


    Notes:
    • Your main form must be shown using vbModal.
    • You will need to modify the program to change the constant named EMAIL to your e-mail address.
    • You should change the registration key algorythm. See CalcRegKey in modProtect and Sub Main in modGenKey. The changes should be the same in both places.

    Hi there, i tried out your project and it works well. I know this is an old post,i hope i can get a reply. What i wanted to know is instead of numbers for the geygen i wanted to figure out letters from the serial number entered.such as 20 letters in @@@@@-@@@@@-@@@@@-@@@@@ format. this is for a program i have i wish to give others and not abused. thanks

  28. #148

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme

    Quote Originally Posted by canadadoya
    Hi there, i tried out your project and it works well. I know this is an old post,i hope i can get a reply. What i wanted to know is instead of numbers for the geygen i wanted to figure out letters from the serial number entered.such as 20 letters in @@@@@-@@@@@-@@@@@-@@@@@ format. this is for a program i have i wish to give others and not abused. thanks
    You can do anything you want with the code. If you wanted to produce letters instead of numbers a simple 1=A 2=B or something more complicated would be easy to do.

  29. #149
    New Member
    Join Date
    May 2007
    Posts
    8

    Question Re: VB - A Program Registration Scheme

    Hi ty for the reply, im a beginner in vb here is what i did
    Code:
    Option Explicit
    
    
    Public Sub Main()
    
        Dim strLicenseKey As String
        Dim lngSerialNum As Long
        Const VALID_CHARS = "ABCDEFGHJKLMNPQRTUVWXY"
        
        lngSerialNum = InputBox("Enter user's hard drive serial number")
        
        ' This calculation must be the same as the one used in your application
        strLicenseKey = CStr(Int(3456 * Sqr(lngSerialNum / 5)))
        strLicenseKey = Left$(strLicenseKey, 20)
        If Len(strLicenseKey) < 20 Then
            strLicenseKey = Left$(VALID_CHARS, 20 - Len(strLicenseKey)) & strLicenseKey
        
        End If
        
        
        strLicenseKey = Format(strLicenseKey, "@@@@@-@@@@@-@@@@@-@@@@@")
        frmGenKey.txtKey = strLicenseKey
        frmGenKey.Show vbModal
        
    
    
    End Sub
    this works to a point i still get 9 numbers at the end and the letters arn't random. i tryed to adapt from another source code, it wouldn't work. see attachment
    Attached Files Attached Files

  30. #150
    Hyperactive Member ProphetBeal's Avatar
    Join Date
    Aug 2006
    Location
    New York
    Posts
    424

    Re: VB - A Program Registration Scheme

    I believe what Martin was sayign to do is something like this (although this may not be the best way to do it )...
    VB Code:
    1. strLicenseKey = Replace(strLicenseKey, "0", "X")
    2.     strLicenseKey = Replace(strLicenseKey, "1", "D")
    3.     strLicenseKey = Replace(strLicenseKey, "2", "G")
    4.     strLicenseKey = Replace(strLicenseKey, "3", "M")
    5.     strLicenseKey = Replace(strLicenseKey, "4", "A")
    6.     strLicenseKey = Replace(strLicenseKey, "5", "E")
    7.     strLicenseKey = Replace(strLicenseKey, "6", "P")
    8.     strLicenseKey = Replace(strLicenseKey, "7", "V")
    9.     strLicenseKey = Replace(strLicenseKey, "8", "B")
    10.     strLicenseKey = Replace(strLicenseKey, "9", "R")

    Helpful Links:
    VB 6 - How to get the "Key" Value in a collection
    VB.NET - File Search Utility || VB.NET - How to compare 2 directories || VB.NET - How to trust a network share
    VB.NET - Create Excel Spreadsheet From Array || VB.NET - Example Code & Hints you may not know
    VB.NET - Save JPEG with a certain quality (image compression) || VB.NET - DragDrop Files, Emails, and Email Attachments

    Please post some of the code you need help with (it makes it easier to help you)
    If your problem has been solved then please mark the thread [RESOLVED].
    Don't forget to Rate this post

    "Pinky, you give a whole new meaning to the phrase, 'counter-intelligence'."-The Brain-

  31. #151
    New Member
    Join Date
    May 2007
    Posts
    8

    Re: VB - A Program Registration Scheme

    thanks prophet that works pretty good, i got the keygen to add a - after every 5 keys but i get numbers again at the first 3 keys
    VB Code Code:
    1. Option Explicit
    2.  
    3.  
    4. Public Sub Main()
    5.  
    6.     Dim strLicenseKey As String
    7.     Dim lngSerialNum As Long
    8.     Const VALID_CHARS = "0123456789"
    9.  
    10.    
    11.     lngSerialNum = InputBox("Enter user's hard drive serial number")
    12.    
    13.     ' This calculation must be the same as the one used in your application
    14.     strLicenseKey = CStr(Int(3456 * Sqr(lngSerialNum / 5)))
    15.     strLicenseKey = Left$(strLicenseKey, 22)
    16.     If Len(strLicenseKey) < 22 Then
    17.         strLicenseKey = Left$(VALID_CHARS, 22 - Len(strLicenseKey)) & strLicenseKey
    18.     End If
    19.    
    20.     strLicenseKey = Replace(strLicenseKey, "0", "X")
    21.     strLicenseKey = Replace(strLicenseKey, "1", "D")
    22.     strLicenseKey = Replace(strLicenseKey, "2", "G")
    23.     strLicenseKey = Replace(strLicenseKey, "3", "M")
    24.     strLicenseKey = Replace(strLicenseKey, "4", "A")
    25.     strLicenseKey = Replace(strLicenseKey, "5", "E")
    26.     strLicenseKey = Replace(strLicenseKey, "6", "P")
    27.     strLicenseKey = Replace(strLicenseKey, "7", "V")
    28.     strLicenseKey = Replace(strLicenseKey, "8", "B")
    29.     strLicenseKey = Replace(strLicenseKey, "9", "R")
    30.     strLicenseKey = Replace(strLicenseKey, "10", "H")
    31.     strLicenseKey = Replace(strLicenseKey, "11", "Y")
    32.     strLicenseKey = Replace(strLicenseKey, "12", "C")
    33.     strLicenseKey = Replace(strLicenseKey, "13", "W")
    34.     strLicenseKey = Replace(strLicenseKey, "14", "U")
    35.     strLicenseKey = Replace(strLicenseKey, "15", "T")
    36.     strLicenseKey = Replace(strLicenseKey, "16", "Q")
    37.     strLicenseKey = Replace(strLicenseKey, "17", "F")
    38.     strLicenseKey = Replace(strLicenseKey, "18", "L")
    39.     strLicenseKey = Replace(strLicenseKey, "19", "J")
    40.     strLicenseKey = Replace(strLicenseKey, "20", "k")
    41.     strLicenseKey = Replace(strLicenseKey, "21", "N")
    42.    
    43.  
    44.     frmGenKey.txtKey = strLicenseKey
    45.     frmGenKey.Show vbModal
    46.  
    47. End Sub
    i was thinking about an MD5 hash to calculate the keygen
    i got that in the attachment in my previous post. HEH MY BRAIN HURTS LOL

  32. #152

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme

    Quote Originally Posted by canadadoya
    thanks prophet that works pretty good, i got the keygen to add a - after every 5 keys but i get numbers again at the first 3 keys
    VB Code Code:
    1. Option Explicit
    2.  
    3.  
    4. Public Sub Main()
    5.  
    6.     Dim strLicenseKey As String
    7.     Dim lngSerialNum As Long
    8.     Const VALID_CHARS = "0123456789"
    9.  
    10.    
    11.     lngSerialNum = InputBox("Enter user's hard drive serial number")
    12.    
    13.     ' This calculation must be the same as the one used in your application
    14.     strLicenseKey = CStr(Int(3456 * Sqr(lngSerialNum / 5)))
    15.     strLicenseKey = Left$(strLicenseKey, 22)
    16.     If Len(strLicenseKey) < 22 Then
    17.         strLicenseKey = Left$(VALID_CHARS, 22 - Len(strLicenseKey)) & strLicenseKey
    18.     End If
    19.    
    20.     strLicenseKey = Replace(strLicenseKey, "0", "X")
    21.     strLicenseKey = Replace(strLicenseKey, "1", "D")
    22.     strLicenseKey = Replace(strLicenseKey, "2", "G")
    23.     strLicenseKey = Replace(strLicenseKey, "3", "M")
    24.     strLicenseKey = Replace(strLicenseKey, "4", "A")
    25.     strLicenseKey = Replace(strLicenseKey, "5", "E")
    26.     strLicenseKey = Replace(strLicenseKey, "6", "P")
    27.     strLicenseKey = Replace(strLicenseKey, "7", "V")
    28.     strLicenseKey = Replace(strLicenseKey, "8", "B")
    29.     strLicenseKey = Replace(strLicenseKey, "9", "R")
    30.     strLicenseKey = Replace(strLicenseKey, "10", "H")
    31.     strLicenseKey = Replace(strLicenseKey, "11", "Y")
    32.     strLicenseKey = Replace(strLicenseKey, "12", "C")
    33.     strLicenseKey = Replace(strLicenseKey, "13", "W")
    34.     strLicenseKey = Replace(strLicenseKey, "14", "U")
    35.     strLicenseKey = Replace(strLicenseKey, "15", "T")
    36.     strLicenseKey = Replace(strLicenseKey, "16", "Q")
    37.     strLicenseKey = Replace(strLicenseKey, "17", "F")
    38.     strLicenseKey = Replace(strLicenseKey, "18", "L")
    39.     strLicenseKey = Replace(strLicenseKey, "19", "J")
    40.     strLicenseKey = Replace(strLicenseKey, "20", "k")
    41.     strLicenseKey = Replace(strLicenseKey, "21", "N")
    42.    
    43.  
    44.     frmGenKey.txtKey = strLicenseKey
    45.     frmGenKey.Show vbModal
    46.  
    47. End Sub
    i was thinking about an MD5 hash to calculate the keygen
    i got that in the attachment in my previous post. HEH MY BRAIN HURTS LOL
    I looks like you don't fully understand how Replace works. What I mean is that your second replace is strLicenseKey = Replace(strLicenseKey, "1", "D"). That's fine but it means that all ones in the key will be replaced by "D" so this line strLicenseKey = Replace(strLicenseKey, "10", "H") and all that follow them will never work since there are no more ones.

  33. #153
    New Member
    Join Date
    May 2007
    Posts
    8

    Re: VB - A Program Registration Scheme

    Hi this is what i did
    Code:
    Private Sub Command1_Click()
       Text1 = GenerateCode()
    End Sub
    
    Public Function GenerateCode()
    
       strInputString = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
       
       intLength = Len(strInputString)
       
       intNameLength = 20
       
       Randomize
       
       strName = ""
       
       For intStep = 1 To intNameLength
           intRnd = Int((intLength * Rnd) + 1)
       
           strName = strName & Mid(strInputString, intRnd, 1)
           
       Next
       
           strName = Format(strName, "@@@@@-@@@@@-@@@@@-@@@@@")
           
       GenerateCode = strName
       
    End Function
    now if i could include the serial number and product id shown in the attachment to generate the key i can rest i guess.Ive tried your code and it doesn't seam to work.
    Attached Images Attached Images  

  34. #154

  35. #155
    New Member
    Join Date
    May 2007
    Posts
    8

    Re: VB - A Program Registration Scheme

    sorry about confusement martin. I wanted to take the circled hard drive serial number and productid in the attached image then in my code generate a license key using both. is that possible or do i need to use license key script from hard key license manager for wich i have.

  36. #156

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427

    Re: VB - A Program Registration Scheme

    The code is yours to do whatever you want to with it. Currently the code just gets the serial number and generates a registration key from it however there is nothing to stop you from combining the serial number and productid somehow and generating the registration code from the result.

  37. #157
    Junior Member
    Join Date
    Jun 2007
    Posts
    28

    Re: VB - A Program Registration Scheme

    I was wondering where in the code it does the saving the code and such to registry so that it can check if it has been installed? I am trying to understand the program so that I can try to use this idea in VB.NET (Express). If anyone knows of some tutorials or if this has already been done I would love to not have to try to re-invent the wheel.

    Brian

  38. #158

  39. #159
    Lively Member
    Join Date
    Aug 2007
    Posts
    82

    Re: VB - A Program Registration Scheme

    Quote Originally Posted by MartinLiss
    Attached is a project (actually two projects) that show one way of having the user register his copy of your program. This is the way it works:

    • The main application displays a registration screen with two options: "Register" and "Request Registration Key".
    • If the user selects "Register" a new screen is shown that asks the user for his name and tells him that if he continues it will generate an e-mail message to you (via MAPI) and that you will send him the registration key by return e-mail. If he continues, the program gets his hard drive serial number and includes it in the e-mail to you.
    • Once you receive the registration request email, you use the second project (GenKey) to generate a registration key by way of a simple algorithm that you can change based on the hard drive serial number. Just remember that the algorithm is in both projects and it must be exactly the same in both.
    • You then send the registration key back to the user and have them enter it in the second part of the registration screen which writes the key to the registry.
    • When they start the main program again it uses the same algorithm to see if the registration key in the Registry matches the HD serial number. If it matches the program starts (see Notes below). If it doesn't match or if there is no registry entry, the program does not start or you could arrange it so that it starts with only a few demo functions available.


    Notes:
    • Your main form must be shown using vbModal.
    • You will need to modify the program to change the constant named EMAIL to your e-mail address.
    • You should change the registration key algorythm. See CalcRegKey in modProtect and Sub Main in modGenKey. The changes should be the same in both places.
    I had a look to your 'A Program Registration Scheme' it looks working OK I will try to make it simple to my application.

    Thank you

  40. #160
    Member
    Join Date
    Sep 2007
    Posts
    61

    Re: VB - A Program Registration Scheme

    Is it possible to modify this so instead of sending an activation code.
    The values "email address" & "HD serial" into my online MySql db?

    I want the program to check the database each time the program runs.

    This way if the user request a refund I can deactivate.

Page 4 of 5 FirstFirst 12345 LastLast

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