-
- VBForums
- VBForums CodeBank
- CodeBank - Visual Basic .NET
- Making a demo/trial version of your software
-
Aug 24th, 2005,10:24 AM #1 Thread Starter Fanatic Member Making a demo/trial version of your software Hello... First of all,i admit this is a silly program..but,I thought it would give an idea to people who are wondering how they can make a trial/demo of their software.This one can be easily cracked..but,this is just an example. PLEASE NOTE: Use "Imports Microsoft.Win32" first before using the code. VB Code: -
Dim filenumber As Integer 'This is a variable were delcaring to get in the value of freefile function.It assigns automatically the value which represents the file -
Dim times_used As Integer = 1 'here,our program sets how many times used so far..were initializing it here -
Dim max_limit As Integer = 5 'Set the maximum number of times he can use here. -
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load -
demosoft() -
regcheck() -
End Sub -
Private Sub demosoft() -
filenumber = FreeFile() 'We assign the number which represents which file to open -
If IO.File.Exists(Application.StartupPath & "\check.myext") Then 'Checking if file exists.. -
FileOpen(filenumber, Application.StartupPath & "\check.myext", OpenMode.Random, OpenAccess.ReadWrite) 'If exists,were opening it in readwrite mode. -
FileGet(filenumber, times_used) 'Were reading from the file the value thats stored..ie the number of times he has used -
MsgBox("You have executed this software " & (times_used) & " times") 'hmmm,were displaying it here..:) -
FileClose(filenumber) 'Lets close the file now. -
If times_used >= max_limit Then 'Were checking if the user has used the software more than the limit specified -
MsgBox("Sorry,Your trial period is over!!Please purchase this software ;-) ") 'oops,if it has exceeded,then,he cant use it :p ;) -
Application.Exit() 'Say Goodbye to the user..cos,he needs to purchase..We exit our app here. -
End If -
times_used = times_used + 1 'if he has used it once before,lets make it 2 now since this is the 2nd time -
FileOpen(filenumber, Application.StartupPath & "\check.myext", OpenMode.Random, OpenAccess.ReadWrite) 'storing the value back here :) -
FilePut(filenumber, times_used) -
FileClose(filenumber) -
Else -
'This part is if the user is using the software for the 1st time.The file has to be created -
FileOpen(filenumber, Application.StartupPath & "\check.myext", OpenMode.Random, OpenAccess.ReadWrite) -
FilePut(filenumber, times_used) 'ok,now he has opened and used once,so,lets write it in here. -
FileClose(filenumber) -
End If -
End Sub -
Private Sub regcheck() -
Dim regKey As RegistryKey 'Declaring a new registry key here -
regKey = Registry.LocalMachine.OpenSubKey("SOFTWARE", True) 'opening this subkey in the registry -
regKey.CreateSubKey("demosoft") 'Were creating a new subkey called Demosoft -
regKey.SetValue("demosoft", times_used) 'We're setting how many times used in the registry -
Try -
times_used = regKey.GetValue("demosoft", 0) 'We're getting how many times used -
Catch ex As Exception -
MsgBox("error") -
End Try -
If times_used > max_limit Then 'Checking if times used is greater than maximum limit -
MsgBox("Your trial period as expired!") 'If it is,well,we display a message box to the user saying its expired.. -
Application.Exit() 'And here,we exit the application again. -
End If -
regKey.Close() 'Our job is done,so we close the regkey here :) -
End Sub Maybe I will add something to check the registry too later.But,i think this would be enough to give an idea of how you can make a trial software that works for only a certain number of times. Hope it helps. Edit:Hello everyone,this is demosoft v2.0 got the registry feature up too just as i said.Hope it helps. Last edited by uniquegodwin; Oct 20th, 2005 at 08:14 AM. Godwin Help someone else with what someone helped you! -
Aug 30th, 2005,05:50 AM #2 Re: Making a demo/trial version of your software This one can be easily cracked agree, this protection is cracked by only deleting your "check.myext" file, and even if you did create a record in the registery. some people may be able to hack it or even reinstall windows with a clean registery. and by the way, you should check for the file "check.myext", if not found don't create it ( you should exit) because that means that the user has deleted it to reset the counter . and for the first time, just supply this file "check.myext" with the program when you first install it . anyway, that was just a hint, you can even increase it's complexity by saving the counter in your file in a coded format (may be a salt algorithm will make it uneasy to understand) at last, use hardware protection dongols , this is the best way to secure your application. rgds -
Aug 30th, 2005,07:01 AM #3 Thread Starter Fanatic Member Re: Making a demo/trial version of your software Hello Maged... Thank you for your suggestion. Yes,I wll try to make it a little better than this. The reason I made it create the myext file was because,i would have to upload the project as attachment if the file was already existing and it wouldnt work if people just copy and paste this code. I am letting it create a file since even people who just copy and paste this can simply see it working. About cracking it,yes,this is dead easy to crack,by just deleting that file and even if i keep a registry check,people can crack that easily too. And even if I use a hardware lock,still,that can be cracked too..lol Microsoft windows,VS2003,Windows Vista beta are all being cracked in that way.Even softwares like 3d studio max which use hardware locks are cracked. If someone is so concerned about making it "crack proof",then,they need to find a good advanced way for it to atleast make it hard to crack.If I give the whole secure program,even the crackers would take it n crack it easily This is just a sample demo.I would also like to show people how to do it on the registry too soon.But,as for making it really secure,they need to do something.I made this specially because,one person asked a question in the forum on how people make trial/demo version that expires.So,i made this sample for anyone else who is wondering the same. Thanks again Maged... Godwin Help someone else with what someone helped you! -
Aug 30th, 2005,09:10 AM #4 Re: Making a demo/trial version of your software thx to you for your kind reply, i know that there noting called crack proof, everything can be cracked. but the issue about securing application is: make the cracking of the software more expensive than buying it. this way most people will buy it because this is easier and cheaper. Hardware locks are hard to crack and provide powerful protection for a relatively low cost, so this will make the previous equation fine. rgds -
Oct 20th, 2005,08:17 AM #5 Thread Starter Fanatic Member Re: Making a demo/trial version of your software Godwin Help someone else with what someone helped you! -
Oct 20th, 2005,08:30 AM #6 Thread Starter Fanatic Member Re: Making a demo/trial version of your software Godwin Help someone else with what someone helped you! -
Dec 4th, 2005,05:04 PM #7 Hyperactive Member Re: Making a demo/trial version of your software I have updated my code...I know nothing big in it... but still,since people asked for a registry one atleast...Ive made the registry fix...Lets call it demosoft v2.0 heh heh Hope it helps Where is the new code? Can you post it? -
Dec 5th, 2005,06:15 AM #8 Thread Starter Fanatic Member Re: Making a demo/trial version of your software Hi.. see in the first post... The regcheck function is added to the old code Godwin Help someone else with what someone helped you! -
- VBForums
- VBForums CodeBank
- CodeBank - Visual Basic .NET
- Making a demo/trial version of your software
Posting Permissions - You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
- BB code is On
- Smilies are On
- [IMG] code is On
- [VIDEO] code is On
- HTML code is Off
Forum Rules | Click Here to Expand Forum to Full Width |
0 Response to "How To Create Trial Version Software In Vb Net"
Post a Comment