|
-
Nov 12th, 2004, 05:18 AM
#81
Hyperactive Member
Interesting Idea
As someone already stated, it's probably not a good idea to base your registration scheme off of hardware. Instead I would look for information that is likely to be unique for a user but will survive some computer upgrades. Take a hash value of this information and then use it to generate the key.
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde
-
Nov 12th, 2004, 06:03 PM
#82
-
Nov 12th, 2004, 08:50 PM
#83
Hyperactive Member
Re: Re: Interesting Idea
Originally posted by manavo11
Like what? What else is as unique as hardware? Something that just wouldn't possibly be the same for two different computers?
You would take a mixture of things from the computer. The windows CD key would be a good place to start. Any personal information should also be added.
Education is an admirable thing, but it is well to remember from time to time that nothing that is worth knowing can be taught. - Oscar Wilde
-
Dec 28th, 2004, 07:24 PM
#84
New Member
Re: VB - A Program Registration Scheme
Hello somebody can of yours help oneself? I descended his code but this does not work for me, when running the protec.vbp error hits on this code to me:
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$ String$ ( 256, 0 )
StrSysName$ String$ ( 256, 0 )
LngResult GetVolumeInformation ( C:, strVolumeBuffer$, 255, lngSerialNumber,
LngComponentLen, lngSysFlags, strSysName$, 255 )
GetSerialNumber lngSerialNumber
End Function
error is in this code, where he marks string$ to me:
StrVolumeBuffer$ String$ ( 256, 0 )
And the error that slips out is :
Error of compilation:
can not find the project or the library
Some of you can of yours help to me?
I say hello from mexico and thanks
-
Dec 28th, 2004, 07:40 PM
#85
New Member
Re: VB - A Program Registration Scheme
I Right now did the trick, only me toward lack the reference to the library outl85.olb that is of outlook98, thanks anyway.
-
Dec 28th, 2004, 08:13 PM
#86
Re: VB - A Program Registration Scheme
 Originally Posted by mykkel
I Right now did the trick, only me toward lack the reference to the library outl85.olb that is of outlook98, thanks anyway.
My code is meant for VB and not VBA.
-
Apr 1st, 2005, 01:54 AM
#87
PowerPoster
Re: VB - A Program Registration Scheme
 Originally Posted by mykkel
Hello somebody can of yours help oneself? I descended his code but this does not work for me, when running the protec.vbp error hits on this code to me:
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$ String$ ( 256, 0 )
StrSysName$ String$ ( 256, 0 )
LngResult GetVolumeInformation ( C:, strVolumeBuffer$, 255, lngSerialNumber,
LngComponentLen, lngSysFlags, strSysName$, 255 )
GetSerialNumber lngSerialNumber
End Function
error is in this code, where he marks string$ to me:
StrVolumeBuffer$ String$ ( 256, 0 )
And the error that slips out is :
Error of compilation:
can not find the project or the library
Some of you can of yours help to me?
I say hello from mexico and thanks
Hi, I am new here. I have downloaded your code. I am too having a problem.
I am running Win XP Home and I was able to compile the program where you can generate the key. But when I go to compile the protect.vbs it tells me the following:
Compile Error:
Can't find project or library
It references:
String$ in the line of strVolumeBuffer$ = String$(256, 0)
for
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$ = String$(256, 0)
strSysName$ = String$(256, 0)
lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
lngComponentLen, lngSysFlags, strSysName$, 255)
GetSerialNumber = lngSerialNumber
End Function
in the modProtect.
Please advise.
Thanks
-
Apr 1st, 2005, 10:17 AM
#88
Re: VB - A Program Registration Scheme
My code is meant for VB and not VBA. Are you using VB6?
-
Apr 1st, 2005, 11:06 AM
#89
PowerPoster
Re: VB - A Program Registration Scheme
 Originally Posted by MartinLiss
My code is meant for VB and not VBA. Are you using VB6?
I am using VB6 Enterprise Edition
What is the difference between VB and VBA?
-
Apr 1st, 2005, 11:11 AM
#90
Re: VB - A Program Registration Scheme
VBA is Visual Basic for Applications and is the form of visual basic that you use from within Word, Excel etc.
What did you mean when you said "compile the protect.vbs"?
-
Apr 1st, 2005, 09:33 PM
#91
PowerPoster
Re: VB - A Program Registration Scheme
 Originally Posted by MartinLiss
VBA is Visual Basic for Applications and is the form of visual basic that you use from within Word, Excel etc.
What did you mean when you said "compile the protect.vbs"?
when i would do F5 when the project is open, or when it would attempt to compile into an exe.
-
Apr 23rd, 2005, 10:31 AM
#92
Hyperactive Member
Re: VB - A Program Registration Scheme
Hey Martin....
Can you tell me what I am doing wrong here... I open your project vb file and I press the play button (F5)..
And I get a compile error - can't find project or library...
I am using Win XP and VB 6.0
The underlined line of code is highlighted blue when I get the error..
VB 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$ = [U]String$[/U](256, 0)
strSysName$ = String$(256, 0)
lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
lngComponentLen, lngSysFlags, strSysName$, 255)
GetSerialNumber = lngSerialNumber
End Function
Thank you for taking the time!
Stilekid007
-
Apr 23rd, 2005, 11:56 AM
#93
Re: VB - A Program Registration Scheme
There may be something in your project that's confusing VB. Try
VB Code:
strVolumeBuffer$ = [HL="#FFFF80"]VBA.[/HL]String$(256, 0)
-
Apr 23rd, 2005, 12:07 PM
#94
-
Apr 23rd, 2005, 05:29 PM
#95
Re: VB - A Program Registration Scheme
Yes, that's the assumption. There are other, more general, ways of sending email and so if you have the need you might want to look into changing the code.
-
May 18th, 2005, 11:07 PM
#96
New Member
Re: VB - A Program Registration Scheme
Hi,
I have tried using this register programming. If i just run, i am getting compile error as "Cannot Find Project or Library". Can anyone suggest me, whether i shd include any library as reference??? Expecting ur reply,
Thanks in advance,
Regards,
dpr
-
May 18th, 2005, 11:28 PM
#97
New Member
Re: VB - A Program Registration Scheme
HELLO,
Thanks a lot for the above suggestions. I read the previous thread and included VBA. The program is working fine.. Thanks a lot.
Regards,
dpr
-
Aug 9th, 2005, 01:31 PM
#98
New Member
Re: VB - A Program Registration Scheme
What would I have to remove and fix, if I wanted it so it skipped the automatic outlook email, and just popped up the manual email form where it says an error has occured, please use your email system to manually send and email to....
Could someone tell me what I need to do?
PS: Im very very new to VB and have no idea what to do on my own.
-Sidewinder
-
Aug 9th, 2005, 03:50 PM
#99
Re: VB - A Program Registration Scheme
You are much better off creating an installation package so the user will be able to use MAPI but here you go.
VB Code:
Public Sub ShowStep1()
cmdNext.Caption = "&Next >"
cmdBack.Enabled = True
lblReg.Caption = "Step 1 - Request Registration Key"
[HL="#FFFF80"]' lblExplain.Caption = "Pressing Next will generate an " _
' & "E-mail requesting a Registration Key. When you receive " _
' & "that key via return E-mail, you can finish the " _
' & "registration process by completing the " & optRegStep(1).Caption _
' & " step, (Step 2)."
lblExplain.Caption = "Press Next and then send me an " _
& "E-mail as you will be instructed to. When you receive " _
& "that key via return E-mail, you can finish the " _
& "registration process by completing the " & optRegStep[/HL](1).Caption _
& " step, (Step 2)."
optRegStep(0).Visible = False
optRegStep(1).Visible = False
lblName.Visible = True
txtName.Visible = True
[HL="#FFFF80"] 'new
txtName.Text = "Press Next"
txtName.Enabled = False[/HL]
lblRegKey.Visible = False
lblRegisterTo.Visible = False
txtRegisterTo.Visible = False
txtRegKey(0).Visible = False
txtRegKey(1).Visible = False
txtRegKey(2).Visible = False
lblDash1.Visible = False
lblDash2.Visible = False
[HL="#FFFF80"]' txtName.SetFocus[/HL]
End Sub
Public Function RequestKey() As Boolean
' Dim strCriteria As String
Dim mpSession As MAPISession
Dim mpMessages As MAPIMessages
On Error GoTo ErrorRoutine
' This causes this validation (for step 1) to
' be bypassed when going directly to step 2
If txtName.Visible = False Then
RequestKey = True
Exit Function
End If
If Trim(txtName) = "" Then
MsgBox "Please enter your name.", _
vbExclamation, REG_ERR_TITLE
txtName.SetFocus
m_StepCompleted = m_StepCompleted - 1
Exit Function
End If
Screen.MousePointer = vbHourglass
Me.Hide
[HL="#FFFF80"]' frmWait.Show
'
' gRegClass.Subject = StrConv(LCase(App.EXEName), vbProperCase) & " Registration Request"
'
' Set mpSession = MAPISession1
' Set mpMessages = MAPIMessages1
'
' mpSession.DownLoadMail = False
' 'show the logon interface for the mail
' mpSession.LogonUI = True
' 'sign on to selected account
' mpSession.SignOn
'
' DoEvents
'
' 'check if logon was successful
' If mpSession.SessionID = 0 Then
' 'SendMAPIMail = False
' MsgBox "Error On login To MAPI", _
' vbCritical, "MAPI"
' Exit Function
' End If
'
' 'set the session IDs the same on both objects
' mpMessages.SessionID = mpSession.SessionID
'
' 'Set the MSgIndex to -1, this needs to be
' 'done for the Compose event to work
' mpMessages.MsgIndex = -1
' 'compose a new message
' mpMessages.Compose
'
' 'don't show the resolve address interface
' mpMessages.AddressResolveUI = False
'
' 'set the recipient
' mpMessages.RecipIndex = 0
' mpMessages.RecipType = mapToList
' mpMessages.RecipAddress = EMAIL
' 'resolve the recipient's email addresses
' mpMessages.ResolveName
'
' 'set the subject
' mpMessages.MsgSubject = gRegClass.Subject
'
' 'set the Message/Body/NoteText
' mpMessages.MsgNoteText = txtName & " " & GetSerialNumber
'
' 'send the message
' mpMessages.Send
'
' 'close the current session
' mpSession.SignOff
'
' 'clear objects
' Set mpMessages = Nothing
' Set mpSession = Nothing
'new
MsgBox "Send me an email which includes your name and this number." _
& vbCrLf & vbCrLf & GetSerialNumber[/HL]
Screen.MousePointer = vbNormal
Unload Me
DoEvents
RequestKey = True
Unload frmWait
Exit Function
ErrorRoutine:
Set mpMessages = Nothing
Set mpSession = Nothing
Screen.MousePointer = vbNormal
frmRegError.Show vbModal
m_StepCompleted = m_StepCompleted - 1
RequestKey = False
Err.Clear
End Function
-
Sep 8th, 2005, 06:08 AM
#100
Hyperactive Member
Re: VB - A Program Registration Scheme
I`m using your code as a foundation to my own registration scheme. It`s been very instructive and helpful. One thing I`d like to ask is why do you tell that the main form of my program has to be loaded in modal mode. My main form is an MDI container form and it crashes when I try to load it in modal mode.
Last edited by divined; Sep 8th, 2005 at 06:13 AM.
SteadFast!
-
Sep 8th, 2005, 09:08 AM
#101
Re: VB - A Program Registration Scheme
Because in the code below if frmDone wasn't shown modally, the code would continue through the unloading of all forms and the immediate ending of the program.
VB Code:
Public Sub Main()
Dim frm As Form ' Create a Form object
GetAppEnvironment ' Calls the routine that finds out if the user is registered
If Not gRegClass.Registered Then ' Registered is a boolean property of theCRegister class
frmRegister.Show vbModal ' If the user is not registered then the register form is displayed
Else
frmDone.Show vbModal ' In this app if the user is registered then frmDone is displayed.
' In your app you would probably replace frmDone with your main form
End If
For Each frm In Forms ' Loop through all the forms...
Unload frm ' and unload them...
Set frm = Nothing ' and set them to Nothing
Next
End ' 99.99999% of the time not needed, but it can't hurt after you've unloaded your forms.
End Sub
-
Sep 9th, 2005, 03:25 AM
#102
Hyperactive Member
Re: VB - A Program Registration Scheme
I`m not doing it exactly that way. I load my main MDI form in non-modal mode. Then , I just unload the form showing the splash screen. All, others forms are unloaded when the main MDI form is closed. So, effectively the program does not terminate. Is there any defect to this method?
-
Sep 9th, 2005, 09:22 AM
#103
Re: VB - A Program Registration Scheme
-
Sep 9th, 2005, 04:21 PM
#104
Fanatic Member
Re: VB - A Program Registration Scheme
first of all, thank you martin for providing such a useful and practical piece of code. this is definitely a good start for anyone out there wishing to implement a registration routine.
however, i am actually a 'protection freak', and believe that some members might not realize that despite being an excellent start, this scheme is very easy to crack.
therefore, though being as i stated an excellent starting point, i would recommend all users of this piece of code to consider implementing some of these suggestions to ensure an increased protection of their software.
i had provided an example of what could be attacked in the scheme, however as you can see in the post here below it has been removed by martin.
unfortunately, it is hard to explain how to protect a software without having a basic understanding of what you are trying to protect from, however i guess martin is right, this might have given bad ideas to some uneperienced vb'ers.
i remain however at disposal to discuss 'concepts' (i won't then distribute code) to honest programmers trying to protect their software.
cheers,
wc.
Last edited by wildcat_2000; Sep 9th, 2005 at 05:32 PM.
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Sep 9th, 2005, 05:12 PM
#105
Re: VB - A Program Registration Scheme
I removed the attachment since code like that should not be distributed on this forum even if you have the best of intentions.
My program is not meant to be foolproof (if there is actually such a thing) but only a "locked door" to keep out the casual hacker.
-
Sep 10th, 2005, 04:49 AM
#106
Hyperactive Member
Re: VB - A Program Registration Scheme
No way of protection is certainly foolproof. While there are fairly simple easy ways to break the scheme proposed my Martin, it is only a matter of time and resources to break more complicated schemes.
It remains a matter of how broad an audience your application is targeted. Not many people will go into lengths to crack an application that is only being used by a few people.
-
Sep 10th, 2005, 07:52 AM
#107
Fanatic Member
Re: VB - A Program Registration Scheme
 Originally Posted by divined
It remains a matter of how broad an audience your application is targeted. Not many people will go into lengths to crack an application that is only being used by a few people.
this is particularly true. however, it is not my intention here to enter another lengthy discussion on the fact that there are no unbreakable protections. we all know that.
my point was that you can seriously 'buy time' before your program protection is broken, and that this scheme, though being as i stated an excellent start, is only useful 'as is' exactly if the audience you are targeting as no interest in doing so (for instance in professional and specific applications).
When your car breaks down,
close all windows and retry 
=> please rate all users posts! <=
-
Nov 9th, 2005, 10:55 AM
#108
New Member
Re: VB - A Program Registration Scheme
Hi
I am facing a silly problem. I downloaded your code as it is and trying to comple it. When I am compiling it, it is giving me an error ie, " Compile Error : Can't find project or library." and closing it. it is getting stuck in this section :
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$ = String$(256, 0)
strSysName$ = String$(256, 0)
lngResult = GetVolumeInformation("C:\", strVolumeBuffer$, 255, lngSerialNumber, _
lngComponentLen, lngSysFlags, strSysName$, 255)
GetSerialNumber = lngSerialNumber
End Function
highlighting String$ in the code. Also I tried to find the defination of String$ by right clicking but the result is "Identifier under cursor is not recognized." Can you tell me how to solve this problem and compile your code.
-
Nov 9th, 2005, 11:24 AM
#109
Re: VB - A Program Registration Scheme
String$ is a member of VBA's Strings class just as are Trim, strConv, Right$, etc. Highlight String$ and press Shift-F2 to open up the Object Browser. Does it find it String$? The only things I can suggest is that you try using String instead of String$ or perhaps VBA.String$. BTW when you type VBA.S does Intellisense show you String$ as one of the possible choices?
-
Feb 17th, 2006, 03:37 AM
#110
New Member
Re: VB - A Program Registration Scheme
can someone pm me the exe files?, b/c my vb is corupt
-
Feb 17th, 2006, 04:17 AM
#111
PowerPoster
Re: VB - A Program Registration Scheme
 Originally Posted by r6k.net
can someone pm me the exe files?, b/c my vb is corupt
i doubt anyone is going to do it and if its a corrupt installation then youre going to have to reinstal VB.
-
Feb 28th, 2006, 04:27 PM
#112
Lively Member
Re: VB - A Program Registration Scheme
Im not sure if this post is still alive but i doo see a post from a few days ago. But i tihnk i have a simple error. When i try to get my serial number from the program i get a negative number (-2072485274) and of course the program does not like that.
I tried change a line of the generaation a someone posted way back, but still that did not help...Any Ideas?
-
Feb 28th, 2006, 05:24 PM
#113
Re: VB - A Program Registration Scheme
 Originally Posted by eddied316
Im not sure if this post is still alive but i doo see a post from a few days ago. But i tihnk i have a simple error. When i try to get my serial number from the program i get a negative number (-2072485274) and of course the program does not like that.
I tried change a line of the generaation a someone posted way back, but still that did not help...Any Ideas?
Just work with the absolute value (using the Abs function).
-
Feb 28th, 2006, 05:31 PM
#114
Lively Member
Re: VB - A Program Registration Scheme
I did try that.
I changed:
VB Code:
strLicenseKey = CStr(Int(3456 * Sqr(lngSerialNum / 5)))
To
VB Code:
strLicenseKey = CStr(Int(3456 * Sqr(Abs(lngSerialNum) / 5)))
On both PRojects but my number still turns out t be:
(-2072485274)
Last edited by eddied316; Feb 28th, 2006 at 05:38 PM.
-
Feb 28th, 2006, 06:38 PM
#115
Re: VB - A Program Registration Scheme
Do
strLicenseKey = CStr(Int(3456 * Sqr(Abs(lngSerialNum) / 5)))
-
Feb 28th, 2006, 07:50 PM
#116
Re: VB - A Program Registration Scheme
I got your PM. If you use the formula I posted in post #115 in both places you will get a value of 70361397.
-
Feb 28th, 2006, 08:10 PM
#117
Lively Member
Re: VB - A Program Registration Scheme
lol...i DID use it in both places
but it doesnt change
I used it in the Main program in the Moduels and the second on on the gen
but stil get the -207...
-
May 23rd, 2006, 11:42 AM
#118
Hyperactive Member
Re: VB - A Program Registration Scheme
Hi guys,
I have read with interest the discusion on the above program. However, I was thinking aloud, suppose my client does NOT have an e-mail address or his machine is not connected to the internet, then how can he be able to install this sofware on his machine|? How do you generate the serial number manually?
Thanks.
-
May 23rd, 2006, 12:53 PM
#119
Re: VB - A Program Registration Scheme
 Originally Posted by osemollie
Hi guys,
I have read with interest the discusion on the above program. However, I was thinking aloud, suppose my client does NOT have an e-mail address or his machine is not connected to the internet, then how can he be able to install this sofware on his machine|? How do you generate the serial number manually?
Thanks.
When the person who doesn't have email installs the program, a value that represents the hard drive serial number will be displayed. Have them phone or snail-mail the value to you. You then run GenKey (as you would normally) and call or snail-mail them back their key.
-
May 24th, 2006, 02:29 AM
#120
Hyperactive Member
Re: VB - A Program Registration Scheme
Sorry, I am trying out the program but I don't see a value that represents the hard drive serial number displayed. How do I get it displayed?
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|