问题
I have a software product written in VB6. It is a paid software product and it has a demo version for 1 month.There is no separate setup file for demo version.The software on entering the product key turns demo to a full version.I used to write the information in registry to track the 1 month for demo version and after that software will not work. Also if windows user is not admin then registry cannot be written to HKLM. If i write registry to HKCU the user can create new user and reuse the software by installing it. So how can i manage the demo version to 1 month and user cannot use it after 1 month without purchasing the key?
回答1:
I would have thought that you would need to create a license key file and store it with the .exe file. It should be encrypted in some manner and would hold details of when it was created and on what machine etc. You could probably circumvent it but it would certainly be robust enough for your requirements.
回答2:
If you're worried about the user creating new user accounts to restart the demo then you'll need to write to a global location. You CAN write to HKLM as a standard if you set up an appropriate location during the setup.
Note that if a user is able/willing enough to create a new user account every 30 days, then no registry entry is going to stop them either.
The best option without a central activation service is to knobble the demo version in some significant way to deter them from prolonged use.
Our software's demo version shuts down after 30 minutes, but they can register a (dated) trial key that allows full access, falling back to demo on expiry.
回答3:
the best way would be to let your software connect to your server, and register its install date there, and let it connect to your server each time it's started
this requires your software to have access to your server though, so it should probably have internet access which might not always be true
another plus of this method is that your software can check for available updates on your server
回答4:
another idea, although i have never tried it :
you could make your application check the file proporties of your application exe and compare that to the current date/time
of course the user can always set his date/time in the future, and then install your application, or install it at the current date/time, and change its date/time to the past before running it
i dont know if your appliction has access to its own properties, but running this gives some data when i run the exe and click in the textbox :
'1 form with
' 1 textbox : name=Text1 multiline=true
Option Explicit
Private Sub Form_Resize()
Text1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub
Private Sub Text1_Click()
Dim intFile As Integer
Dim strFile As String
Dim lngSize As Long
Dim dateMod As Date
Dim fs As New Scripting.FileSystemObject
Dim f As File
Text1.Text = ""
' length of file
strFile = App.Path & "\FileProp.exe"
intFile = FreeFile
Open strFile For Input As #intFile
lngSize = LOF(intFile)
Close intFile
Text1.SelText = "LOF : " & CStr(lngSize) & vbCrLf
' last modified
dateMod = FileDateTime(strFile)
Text1.SelText = "FileDateTime : " & CStr(dateMod) & vbCrLf
' filesystemobject
Set f = fs.GetFile(strFile)
Text1.SelText = "fs.DateCreated : " & f.DateCreated & vbCrLf
Text1.SelText = "fs.DateLastAccessed : " & f.DateLastAccessed & vbCrLf
Text1.SelText = "fs.DateLastModified : " & f.DateLastModified & vbCrLf
End Sub
来源:https://stackoverflow.com/questions/14931692/managing-the-demo-version-of-software