I have a program I need to protect from piracy. Has anyone got any suggestions as to the best way to go about this. Presumably some sort of "dongle" system is the way to go?
I don't even know what a dongle system is.... but I will say that going about protecting your program from piracy is going to be a difficult task. There have been hundreds of attempts, most of which fail. You can make it secure from the majority of users, who "don't know", but for a lot of people, piracy is a skill that they are going to keep practicing.
There is a way to create a thirty-day free trial (if that interests you). This hard codes the license key code into each copy of the application (you have to compile multiple times in order to give it to multiple users if you do not want them to share codes).
This code (below) is from a real application I wrote - in VB-6. I hope this helps you.
' Component : frmRegCode
' Project : NewNotes
' Description: [a form to register the Notepad for permanent use]
' Modified : 4/8/2005
Dim strFirstRun As String, lngDaysRun As Long, strRegCode As String, _
strValidCode As String, strUser As String
Private Sub cmdSubmit_Click()
Rem: validate the registration code, save the code to the registry
strValidCode = "test code"
strRegCode = txtRegCode.Text
If strRegCode = strValidCode Then
lblWarning.Visible = False
Call VBA.SaveSetting(App.EXEName, "Copyright", "RegCode", strRegCode)
Me.Visible = False
frmNote.mnuHelpRegister.Enabled = False
lblWarning.ForeColor = vbRed
lblWarning.Caption = "Warning: Invalid Registration Code" & vbCrLf
lblWarning.Caption = lblWarning.Caption & "Please e-mail email@example.com"
lblWarning.Caption = lblWarning.Caption & vbCrLf & "to obtain a validated code"
lblWarning.Visible = True
Private Sub Form_Load()
strRegCode = VBA.GetSetting(App.EXEName, "Copyright", "RegCode", "")
strUser = VBA.GetSetting(App.EXEName, "Copyright", "UserID", "")
Rem: If the reg code is blank or invalid...
strFirstRun = VBA.GetSetting(App.EXEName, "Copyright", "strfirstrun", .Date$)
lngDaysRun = VBA.DateDiff("d", strFirstRun, VBA.Date$)
If (lngDaysRun > 30) Then
strRegCode = txtRegCode
Me.cmdSubmit.Enabled = False
Private Sub txtName_LostFocus()
Private Sub txtName_Validate(Cancel As Boolean)
txtName = Trim$(txtName)
If IsNull(txtName) Then
Cancel = True
Cancel = False
If Cancel = True Then
txtName.BackColor = vbRed
lblName.ForeColor = vbRed
txtName.BackColor = vbWhite
lblName.ForeColor = vbBlack
Private Sub txtRegCode_Validate(Cancel As Boolean)
txtRegCode = Trim$(txtRegCode)
If Not IsNull(txtRegCode.Text) Then
Cancel = False
Else: Cancel = True
cmdSubmit.Enabled = Not Cancel
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.
Private Sub btn_addline_Click(ByVal ...
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
OK, so HostGator for some reason no longer allows gcc/g++ access unless you have a Designated Server account, which is a lot of money to spend just to compile my "Hello World" program. Thus I figured I'd compile at home, then upload. Program is your regular old bare-bones Hello World ...