-
Jan 14th, 2012, 03:29 AM
#1
Thread Starter
Member
Make software expire on DATE
Hi,
I have VB Express and I need to make my sofware expire on a certain date. I do not want it like a trial period, I want every edition of the software to expire at the same time (15/02/12). I also do not want the software to be tricked if the system clock is put back so it needs to store the date the software is first launched and calculate the diference so it knows the true date. When the software has expired I need a message box to open, with a yes and no button. If the user clicks the yes button an IE window opens to my channel on youtube and if they click no the program exits. I have tried everything but I can't work it out.
Here is my code:
Code:
Public Class home
Private Sub Label1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Label1.Click
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
about.Show()
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
signup.Show()
End Sub
Private Sub CheckBox1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox1.CheckedChanged
If ProgressBar1.Value = 0 Then
ProgressBar1.Value = ProgressBar1.Value + 1
Else
ProgressBar1.Value = ProgressBar1.Value
End If
If CheckBox1.Checked Then
CheckBox2.Enabled = True
Button2.Enabled = True
Button1.Enabled = False
Else
CheckBox2.Enabled = False
Button2.Enabled = False
Button1.Enabled = True
End If
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CheckBox2.CheckedChanged
If ProgressBar1.Value = 1 Then
ProgressBar1.Value = ProgressBar1.Value + 1
Else
ProgressBar1.Value = ProgressBar1.Value
End If
If CheckBox2.Checked Then
TextBox1.Enabled = True
Button3.Enabled = True
Button2.Enabled = False
Button1.Enabled = False
Else
TextBox1.Enabled = False
Button3.Enabled = False
Button2.Enabled = True
Button1.Enabled = False
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
finishoffer.Show()
End Sub
Dim timercount As Integer = 60 'The number of seconds
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
If ProgressBar1.Value = 2 Then
ProgressBar1.Value = ProgressBar1.Value + 1
Else
ProgressBar1.Value = ProgressBar1.Value
End If
If TextBox1.Text = 0 Then
MsgBox("You must enter a number of referals above '0'", MsgBoxStyle.Information, "Error")
Else
Button5.Enabled = True
Timer1.Enabled = True
Timer1.Interval = 1000
Timer1.Start()
ProgressBar2.Value = 0
ProgressBar2.Minimum = 0
ProgressBar2.Maximum = TextBox1.Text
End If
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
ProgressBar2.Value += 1
ProgressBar2.Refresh()
If ProgressBar2.Value = TextBox1.Text Then
Timer1.Enabled = False
MsgBox("All referals have been generated and sucessfully added to your account. Please allow 48 hours for them to appear", MsgBoxStyle.Information, "Referals Generated")
End If
End Sub
Private Sub home_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Button5.Enabled = False
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Timer1.Stop()
Button1.Enabled = True
CheckBox1.Checked = False
CheckBox1.Enabled = True
Button3.Enabled = False
CheckBox2.Checked = False
CheckBox2.Enabled = False
Button5.Enabled = False
TextBox1.Text = 0
TextBox1.Enabled = False
ProgressBar1.Value = 0
ProgressBar2.Value = 0
Button2.Enabled = False
End Sub
End Class
(Please ignore the awfull coding practices ;D ) Could whoever helps me put comments in any code as im not great at vb. Thanks
-
Jan 14th, 2012, 03:46 AM
#2
Re: Make software expire on DATE
I suggest that you invest in a licensing component, which are built to do this sort of thing. Anything can be cracked if someone is skilful and determined enough. Anything you would do yourself could br cracked easily by someone with moderate skill and determination, or maybe even less, unless you spent quite a bit of time on it. I haven't used them all obviously but one that I have used and found to be quite good, easy to use and not too expensive is Infralution Licensing System.
-
Jan 14th, 2012, 04:00 AM
#3
Thread Starter
Member
Re: Make software expire on DATE
Thanks, but i'm not worried about it being cracked. all the software contains is a monthly newsletter. I just want to make it so that a user has to download a new version each month. The magazine if for a school, and I am only 13 so i cant afford anything like that. Any ideas? (The first version of the software has to be released tommorow so i need something fast.)
-
Jan 14th, 2012, 06:05 AM
#4
Re: Make software expire on DATE
Would it just not be easier for you app to go and get the current newsletter and show it to the user? The user would never have to change the software and it would make the process smoother.
-
Jan 14th, 2012, 06:07 AM
#5
Thread Starter
Member
Re: Make software expire on DATE
I would like the program to be available off line and if it just dislayed it using something like the webbrowser then you would need an internet connection
-
Jan 14th, 2012, 06:09 AM
#6
Re: Make software expire on DATE
You just download the latest version on startup and save it. If you can not download the latest, just display the one you last downloaded. You could even download the info to a folder and create a history system that shows previous newsletters.
-
Jan 14th, 2012, 06:11 AM
#7
Thread Starter
Member
Re: Make software expire on DATE
How would you save it. (It is PDF)
-
Jan 14th, 2012, 06:12 AM
#8
Thread Starter
Member
Re: Make software expire on DATE
would it be possible to display a message every 15th of the month telling the user there is a new version available with yes/no to download it?
-
Jan 14th, 2012, 12:08 PM
#9
Re: Make software expire on DATE
Why check on a certain day? Just download it when one is available! Is that not the point of the whole app? Downloading a file is easy, there are numerous tutorials on the net, just have a quick search, there is likely one in the codebank.
-
Jan 14th, 2012, 05:16 PM
#10
Thread Starter
Member
Re: Make software expire on DATE
Great, thanks. Got it to work, and it saves the file and also displays a message when the program is closed if a new version is available.
Tags for this Thread
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
|