Page 2 of 5 FirstFirst 12345 LastLast
Results 41 to 80 of 178

Thread: VB - A Program Registration Scheme

  1. #41

  2. #42
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    I have sent the email, like I said in the email, I am very grateful, Thanks

  3. #43
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    Martin, If I update the vb files, And add more stuff, once installed on a computer where it hasnt been registered, will it still ask for the registration?

  4. #44

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427
    Originally posted by Cosmictej
    Martin, If I update the vb files, And add more stuff, once installed on a computer where it hasnt been registered, will it still ask for the registration?
    No, once registered the user is always registered unless they change their hard drive.

  5. #45
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    Thanks Martin for all your help

  6. #46
    Frenzied Member
    Join Date
    May 2003
    Location
    So Cal
    Posts
    1,564
    MAC ID is a solid number to use as well. At least that only changes if you change NIC's/Motherboards with onboard NICs.

  7. #47
    Addicted Member
    Join Date
    Mar 2001
    Location
    India
    Posts
    134
    Hey Martin

    I've downloaded the files and tried to run Protect.vbp file from the IDE. I've selected the Request Registration Key option, entered my name and clicked next. It generates error at the line
    VB Code:
    1. [COLOR=crimson]mpMessages.ResolveName[/COLOR]

    The error says

    Runtime Error '32026'

    Not Supported


    Could u pls. Help me with this
    Pavan Kumar

  8. #48

  9. #49
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    Umm, Martin I recieved an email from someone wanting to register my program and it says this Dinger3410 472400162 but when I enter it in the gen. It dont work I didnt change any of the algo

  10. #50

  11. #51
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    Its ok, I worked it out, basically the guy who registered, the name included numbers Thanks Martin

  12. #52
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    Martin, I updated my files, and now poeple who have registered, cant register and cant use the functions as it asks them to register.

  13. #53

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427
    Originally posted by Cosmictej
    Martin, I updated my files, and now poeple who have registered, cant register and cant use the functions as it asks them to register.
    I'm sorry but I don't understand what you are saying.

  14. #54
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    Umm basically, I updated the files and sent them 2 people who had the older version. It doesnt ask them to register but instead when they use it where this code is
    If Not gRegClass.Registered Then
    MsgBox "You must be registered in order to use this function.", vbInformation, "Not Registered"
    Exit Sub
    End If

    they cant use the program. I need it to realise this is an update.

  15. #55

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427
    Do you have the program code set up properly? The following is the important code. (frmDone should be replaced by your normal first form). Note that Sub Main calls GetAppEnvironment and if the person is registered then gRegClass.Registered gets set to True.

    Did you send them the code that included my code?

    VB Code:
    1. Public Sub Main()
    2.  
    3.     Dim frm As Form ' Create a Form object
    4.    
    5.     GetAppEnvironment ' Calls the routine that finds out if the user is registered
    6.    
    7.     If Not gRegClass.Registered Then ' Registered is a boolean property of theCRegister class
    8.         frmRegister.Show vbModal ' If the user is not registered then the register form is displayed
    9.     Else
    10.         frmDone.Show vbModal ' In this app if the user is registered then frmDone is displayed.
    11.                              ' In your app you would probably replace frmDone with your main form
    12.     End If
    13.    
    14.     For Each frm In Forms ' Loop through all the forms...
    15.         Unload frm        ' and unload them...
    16.         Set frm = Nothing ' and set them to Nothing
    17.     Next
    18.    
    19.     End ' 99.99999% of the time not needed, but it can't hurt after you've unloaded your forms.
    20.  
    21. End Sub
    VB Code:
    1. Public Sub GetAppEnvironment()
    2. '***************************************************************************
    3. 'Purpose: Get the application environment
    4. 'Inputs:  None
    5. 'Outputs: None
    6. '***************************************************************************
    7.  
    8.     Dim strKey As String
    9.    
    10.     On Error GoTo ErrorRoutine
    11.    
    12.     strKey = GetSetting(App.EXEName, "Registration", "Registration Key", "123456789")
    13.     If strKey = CalcRegKey(GetSerialNumber) Then
    14.         gRegClass.Registered = True
    15.         g_strRegTo = GetSetting(App.EXEName, "Registration", "User", "Registered User")
    16.     Else
    17.         gRegClass.Registered = False
    18.     End If
    19.    
    20. ErrorRoutine:
    21.  
    22.     If Err.Number <> 0 Then
    23.         DisplayError "GetAppEnvironment"
    24.         End
    25.     End If
    26.  
    27. End Sub

  16. #56
    Lively Member
    Join Date
    Dec 2003
    Posts
    121
    Mate you sorted it our for me

  17. #57

  18. #58
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609
    Yet another question for you Marty.

    I used inno Setup to compile my setup file.
    At which point I tried the disc on another machine - but the registration program didnt come up - it just went straight to the first form!
    What do I need to include in the install? Any registry entries? INNO didnt seem to pick up on anything.

    Cheers

    Eve
    xxx
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  19. #59

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427
    The setup won't affect anything; everything that's needed is in the code. Take a look at the code I posted a couple of posts up for Cosmictej where I showed what Sub Main and GetAppEnvironment should look like. Did you include that code and does your code look like that?

  20. #60
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609
    Originally posted by MartinLiss
    The setup won't affect anything; everything that's needed is in the code. Take a look at the code I posted a couple of posts up for Cosmictej where I showed what Sub Main and GetAppEnvironment should look like. Did you include that code and does your code look like that?
    Yup they are identical
    I wish they werent - it would probablly make it simpler lol
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  21. #61

  22. #62

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427
    evexa, I looked at your code and the project Startup Object should be Sub Main and not Form1. The way it works is that Sub Main calls the routine that finds out if the user is registered. If the user is registered then Sub Main displays Form1 otherwise it displays frmRegister.

    (My 9000th post!)

  23. #63
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609
    Marty your suggestion worked perfectly thank you so much!

    There is however one thing **
    The function includes a square root, a hard drive i tested had a negative number and obviously will not work with the sqrt.

    I tried adding aline to say :

    if strlicenceetc < 0 then strelicenceetc = (int(strelicenceetc * -1))

    but it didnt work.

    Any idea what i should do?

    THank you
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  24. #64

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

    You don't have to use the alogrythm that I use at all so you can make one up that doesn't use the square root, or you can use the Absolute Value function (I thinks it's Abs but I can't check it now) before taking the square root. Whatever you do however make sure that you make the algorythm the same in both places.

  25. #65
    Fanatic Member evexa's Avatar
    Join Date
    Apr 2003
    Location
    USA
    Posts
    609
    Cheers Marty everything works perfectly now (well except for a registration error that occurrs but i think thats due to software on my machine that blocks silent emails.)

    Thanks again!
    xxx


    Originally posted by MartinLiss
    A couple of suggestions.

    You don't have to use the alogrythm that I use at all so you can make one up that doesn't use the square root, or you can use the Absolute Value function (I thinks it's Abs but I can't check it now) before taking the square root. Whatever you do however make sure that you make the algorythm the same in both places.
    Trust no one

    ----------------------------------------
    http://www.eccentrix.com/members/xeaudrey/exanegotium.html
    http://www.eccentrix.com/members/xeaudrey/

  26. #66
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    Originally posted by MartinLiss
    (I thinks it's Abs but I can't check it now)
    Yep, it is


    Has someone helped you? Then you can Rate their helpful post.

  27. #67
    Fanatic Member Slaine's Avatar
    Join Date
    Jul 2002
    Posts
    641
    Excellent work Martin.

    Just one suggestion to the people using this - You really do need to change the algorithm otherwise anybody can download the files above and generate keys for your program.
    Martin J Wallace (Slaine)

  28. #68

  29. #69
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434
    Hello Marty

    I have a question that is VB 101 I'm sure but I can't find a reference to this type of usage, the so here we go:

    In your code you append a $ to the end of some variables. I know that the $ is code for string variable. But you have already declared the variable as a string at the start of the function. So what is the purpose of the $ at this point?

    Thanks

    David

  30. #70

  31. #71
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434
    Hello Marty

    I have the program setup and working.

    But my users get wigged out and shut it down when the program resolves the recipname and then again when it sends the email.

    Either Outlook (depending on their security settings) or their anti-virus program will pop up a dire message on attempting to resolve the address that a virus may be attempting to access your address book and do you want to stop it?

    Then it happens again when it goes to send the message and you get a simularly frightening warning. I tried remming out the resolvename line To at least get rid of the most dire of the two messages, but now it won't send the message and throws the dreaded error 32002 unspecified error.

    Any ideas?

    Thanks

    David

  32. #72

    Thread Starter
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,427
    Perhaps you could remove the automatic email and instead pop up a message saying something like "In order to register, please cut and paste the following information and send it in an email to..."

  33. #73
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434
    Is there a way to mail something without going thru Outlook?

    Mapi appears to just be a portal to the installed email client. So, it looks like I will have to use something else to bypass Outlook. Any ideas?

    Also what is the purpose of "resolving" the email address in outlook? I'm confused as to why when I supply it with an email addy thru the code it still needs to look it up in the outlook addy book.

    If I could get it to send with out the name resolve it might be doable. As most people will ignore one mild warning if they trust the app. But almost no one will bypass the 3 dire "THIS MAY BE A VIRUS" warnings that mapi triggers in outlook.

    Thanks

    David
    Last edited by David RH; May 5th, 2004 at 11:53 AM.

  34. #74

  35. #75
    Hyperactive Member
    Join Date
    May 2002
    Posts
    434
    I also found this:
    http://www.freevbcode.com/ShowCode.Asp?ID=109

    I've given it a short test run and so far it seems to work very well. I'm going to send it to beta testers to see if it holds up under stress.

    David

  36. #76
    Hyperactive Member Dasiths's Avatar
    Join Date
    Apr 2001
    Location
    Colombo, Sri Lanka
    Posts
    331

    what if the user gets a new hard disk

    What if the user gets a new hard disk .....
    he will have to register again ?

    I use the same system with my program ..... and this is one of the problems I had to encounter .........

    I save my registration info on a file .... is it better to store it on the registry ....... ?
    Last edited by Dasiths; Jul 16th, 2004 at 02:49 PM.
    It is the mark of an instructed mind to rest satisfied with the degree of precision which the nature of the subject admits, and not to seek exactness when only an approximation of the truth is possible.
    -Aristotle As quoted in Rapid Development, chapter 8, page 167.

  37. #77

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

    Re: what if the user gets a new hard disk

    Originally posted by Dasiths
    What if the user gets a new hard disk .....
    he will have to register again ?

    I use the same system with my program ..... and this is one of the problems I had to encounter .........

    I save my registration info on a file .... is it better to store it on the registry ....... ?
    Yes, the user will need to register again if he gets a new hard disk. I obviously think it's better to store the info in the Registry but some people like using files.

  38. #78
    Fanatic Member ZeBula8's Avatar
    Join Date
    Oct 2002
    Posts
    548
    could possibly be the reason the hard drive is showing as 0 is that the disks have been made as 'dynamic' under xp operating system?

  39. #79
    Hyperactive Member
    Join Date
    Aug 2004
    Posts
    344
    Hi.....For the above code, may I know whether it is possible to modify it for my appforge program. My appforge program requires the user to register the name and product ID which is given by us and after the user register the name, he or she will be unable to change the name. My program is a chat program between a PDA and a desktop computer, so whenever the user message the computer using the PDA, the user name will be displayed. Assistance is much needed! Thank you for all the help!

  40. #80

Page 2 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