Answered by:
Code for creating trial version of software created in VB.Net 2005?

Question
-
I have created a windows application in VB.Net 2005 using MS Access as backend.
Now before delivering its setup to client I have to create its trial version of 30 days and 60 days.
How to do this ?
Also my setup should be installed only on one computer.
I mean my setup copy should be used for one time only.
I know how to deploy the project i.e. I can create a simple setup of my project.
Wednesday, December 12, 2007 7:13 AM
Answers
-
Hi, I think this could be a complicated way.
You could test with:
Adding a timer, adding the "Microsoft.Win32;".
You could allso add an for example dllimport which allows you to get access to the user32.dll .
At the user32.dll you could set a timer or an intervall that allows the program to for example: after 30 day dislpay activation dialog.
Code Example:Imports System.Runtime.InteropServices
Imports Microsoft.Win32;
<DllImport("User32.dll", 'Add more code here'>I can't help you more right now, but visit: www.msdn.microsoft.com
The CMS for my site isn't yet finished, I think it will been finished at the begining of 2008. I will write articles about: Visual Basic, Visual C# and Visual C++ so you could read there.
Saturday, December 15, 2007 11:11 AM -
For 30 days or 60 days trial:
check the date on installation or on first run of program(the setting variable will be 0 in first time):
save the current date in the setting variable
now every run read that variable and see if the software is expired: it is better to read the date from internet using web service
for install the software on only one computer:
create setting variable for example license
when the software run check this variable if it is not contain the correct value then:
1- the software read the processor number
2- the user give you the number by phone or email or...
3- you generate the license key from processor number(by calculation manually or by calculation with small software)
4- you give it to the user
5- the software save it in setting variable
6- the software must check the setting variable and the processor number and make the calculation to see if it contain the current number before starting,if not it will give the processor number to user to send it to you
and so the license key will work only on one computer.
Saturday, December 15, 2007 1:41 PM
All replies
-
Hi, I think this could be a complicated way.
You could test with:
Adding a timer, adding the "Microsoft.Win32;".
You could allso add an for example dllimport which allows you to get access to the user32.dll .
At the user32.dll you could set a timer or an intervall that allows the program to for example: after 30 day dislpay activation dialog.
Code Example:Imports System.Runtime.InteropServices
Imports Microsoft.Win32;
<DllImport("User32.dll", 'Add more code here'>I can't help you more right now, but visit: www.msdn.microsoft.com
The CMS for my site isn't yet finished, I think it will been finished at the begining of 2008. I will write articles about: Visual Basic, Visual C# and Visual C++ so you could read there.
Saturday, December 15, 2007 11:11 AM -
For 30 days or 60 days trial:
check the date on installation or on first run of program(the setting variable will be 0 in first time):
save the current date in the setting variable
now every run read that variable and see if the software is expired: it is better to read the date from internet using web service
for install the software on only one computer:
create setting variable for example license
when the software run check this variable if it is not contain the correct value then:
1- the software read the processor number
2- the user give you the number by phone or email or...
3- you generate the license key from processor number(by calculation manually or by calculation with small software)
4- you give it to the user
5- the software save it in setting variable
6- the software must check the setting variable and the processor number and make the calculation to see if it contain the current number before starting,if not it will give the processor number to user to send it to you
and so the license key will work only on one computer.
Saturday, December 15, 2007 1:41 PM -
Can we check processor no. automatically i.e. from VB.Net code.
Or I think we could get MAC address automatically and it si also unique for one machine.
Also regarding trial version. I cann't check it through internet.
So if I set it locally then user can change system date and my software would be accessible.
How to deal with this?
Monday, December 17, 2007 4:54 AM -
their is another way:
you can make the software work just :60 times or 30 times
create number start from 0 and save it some where
every time the user open the software add 1 to the number
check if the number<=60 or 30 or 100 or what ever you want.
Monday, December 17, 2007 5:27 AM -
Trial version for 30 times run doesn't look like professional way.
So I am looking for something which will work for 30 days.
Wednesday, December 19, 2007 10:02 AM -
How about you make an variable that contains the date when the setup first installed the software. Every times the program load, it will check the date.
To avoid the reinstalling, maybe you can make a "spot" in the registry.Wednesday, February 27, 2008 3:51 PM -
OK, you want to a 30 day trial in which they can't just reinstall to get their 30 days back and everything.
The best way to do this would be to make it run for so long instead of a 30 day period, such as making it run for 30 days being 24 hours per day * 30 and making it able to run for a total of 720 hours before expiring, counting every single second of it, and then saving that somewhere in which you think they will not be able to find it.
The important thing is also for them not being able to change the data, so you might also do some kind of encryption.
As for reinstalling the app, that file will still be there telling them that theyre time is up.
As for people deleting this file and getting more time, well that would not happen, because it will if it ever gets corrupt add another file with some kind of "random" texts, and if that file is there, then they will not be able to reinstall, and it will have some kind of "random" name so that it will make it harder to find.
If any of the files are corrupt upon startup then it will go to creating some variable in something in the registry, and possibly under something that is part of something else in the registry that does not include the name of the program or anything so its pretty much impossible to find.
GOOD LUCK with your program!!!
Sunday, March 9, 2008 9:04 AM -
Hi! I've found another method to help you...
Do like this:
Code SnippetPublic Function ToLocalTime As DateTimeand
Code SnippetDim instance As DateTime
Dim returnValue As DateTime
returnValue = instance.ToLocalTime()Or
Code Snippet<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public MustInherit Class TimeZone
and
Code SnippetDim instance As TimeZoneYou could use one of this methods to create a function that get the time and by getting the current time, date and day you could set another function that goes from this date and 30-day’s forward + by adding a registry value somewhere on the registry, When you create the software installation program or package then add a registry value that could been added automatically to the Windows registry.
Next, you do like this create a small exe file and let this exe file to been installed inside this folders:
C:\Windows\system32\example.exe
Next every time the software starts it goes to the registry and checks the value if the value still the same as the installation program has installed or added then continue running normally but after 30-days run at the startup the:
C:\Windows\System32\example.exe
When the example.exe will run it will automatically change the registry value and if the user clicks on exit and restarts the program it will automatically read the reg-value and if it have been changed then the program would change the Application startup properties to make another window to startup and that windows could been closed by the user the user must start Task Manager to close the process of the program.
Next when this dialog appears on the screen it will ask for a product key if the product key is right the it would automatically remove the 30-day functions and make the software run normally.
You could also add the:
Dllimport functions with ("user32.dll").
Or
I’ve found one more idea for you:
You could test it if you want, do like this:
- Click on Start and choose Run
- Write the following thing to run as an example:
“at 08:55, C:\Windows\System32\cmd.exe”
this would automatically been added to the “Scheduled Tasks” and it would run at that time in the background as SYSTEM, but you could try to found a way to make it after 30-days.
System.Diagnostics.Process.Start(“at example, C:\Windows\System32\Example.exe”)
This is another method which I’ve just tested.
I wish you the Best of luck!
Saturday, March 15, 2008 9:27 PM -
I have created an entry in the registry that the program compares to see if still valid. But now how do I prevent the user from just turning back the date on his PC?Thursday, August 28, 2008 5:36 PM
-
Hi!
If I would tell the truth I would recommend you to use C# for this type of task/job.
First you need to work with CLSID in the registry:
if(value="{0000-BCFGM-UTSKL-TTSTRAT-TTTSES}")
{
TrialNotifyDialog notify = new TrialNotifyDialog();
notify.ShowDialog();
}
else if(value="{xxxx-xxxxx-xxxxx-xxxxxxx-xxxxxx}")
{
//The program has been activated and will work 100% with it's functionality.
}
More information here: http://msdn.microsoft.com/en-us/library/ms691424(VS.85).aspx
You could use a code which gets the first-time start date and prints that date into a
int memory = 0;
import any Windows Dynamic Link Library (Dll)
and let the application first go to a hidden registry value and check if the "IsFirstTime" DWORD value is 1 then print the date and in the memory.
the
memory = date ;
and next the "IsFirstTime" DWORD value will be changed to 0.
The application will then check the first time date from the memory and for each day count down until it has been going 30-days from the firstday date memory print.
like this the app starts and validates the DWORD if 1 then memory print date and save next change the DWORD value to 0.
Next time startup read the printed date and count down for each day...+ calculate which day to stop which means the you need to add another function which then will block the program on the other days and not just the 31-day.
How to read a DWORD value in C#?
using Microsoft.Win32; RegistryKey readvalue = Registry.LocalMachine.OpenSubKey("SOFTWARE\\Microsoft\\Windows Mail\\); Int32 read = (Int32)readvalue("Disable Hotmail"); //Represents a 32-bit signed integer label1.Text = "" + read.ToString();
I hope my information helped you solve your problem,
have a great day...
Regards,
Fisnik
Coder24.com- Edited by Fisnik Hasani Saturday, August 30, 2008 12:56 PM * SPELLFIX *
Saturday, August 30, 2008 12:50 PM -
sred13 said:
I have created an entry in the registry that the program compares to see if still valid. But now how do I prevent the user from just turning back the date on his PC?
Hi!
Show me an code example of It' I can help you to make it harder for the user to crack this.
Have a great day...(I have been working with security and I know how to block the user from add or removing any registry value to make it as an originall without paying any money)
Regards,
Fisnik
Coder24.comSaturday, August 30, 2008 1:00 PM -
Also consider a ready made licensing system such as CryptoLicensing (http://www.ssware.com/cryptolicensing/cryptolicensing_net.htm ) which supports all your requirements - 30,60, N day trial licenses from the date of first install, hardware-locked licenses, etcSaturday, December 5, 2009 9:56 AM
-
Check out Quick License Manager by Soraco Technologies. They support perpetual, trial and subscription licences.
Ralph Michel
Thursday, August 24, 2017 5:12 PM