4 Replies - 966 Views - Last Post: 09 August 2011 - 01:20 PM Rate Topic: -----

#1 xhaxxor  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-August 11

*HELP* trial app- how to stop users from changing date to extend trial

Posted 08 August 2011 - 10:25 PM

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Settings.registered = True Then
            Form3.Show()
            Me.Close()
        End If
        Label3.Text = DateTime.Now
        If My.Settings.exdate = Nothing Then
            My.Settings.exdate = DateTime.Now.AddSeconds(30)
        End If
        Label4.Text = My.Settings.exdate
    End Sub
    Public Sub refreshtime()
        Label3.Text = DateTime.Now
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        refreshtime()
        If DateTime.Now > My.Settings.exdate Then
            Timer1.Stop()
            MsgBox("Expired")
            Dim serial As String
            serial = InputBox("Enter Serial", "Serial", , , )
            If serial = 1234 Then
                My.Settings.registered = True
                Form3.Show()
                Me.Close()
            Else
            End If
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim serial As String
        serial = InputBox("Enter Serial", "Serial", , , )
        If serial = 1234 Then
            My.Settings.registered = True
            Me.Hide()
            Form3.Show()
        End If
    End Sub
End Class



This is my code for a trial application. The code is pretty basic but what i couldn't figure out was how i would be able to prevent users from changing the date to extend the trial ("error" i would be getting). I am completely lost in how i would be able to manage this problem. Any ideas, codes, or a push in the right direction would be appreciated. Thanks.

Also, i have tried searching for some code to help out with this with no luck, not sure if i missed something?

Is This A Good Question/Topic? 0
  • +

Replies To: *HELP* trial app- how to stop users from changing date to extend trial

#2 xhaxxor  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 08-August 11

Re: *HELP* trial app- how to stop users from changing date to extend trial

Posted 08 August 2011 - 10:52 PM

Public Class Form1

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If My.Settings.registered = True Then
            Form3.Show()
            Me.Close()
        End If
        Label3.Text = DateTime.Now
        If My.Settings.exdate = Nothing Then
            My.Settings.exdate = DateTime.Now.AddSeconds(30)
        End If
        Label4.Text = My.Settings.exdate
    End Sub
    Public Sub refreshtime()
        Label3.Text = DateTime.Now
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        refreshtime()
        If DateTime.Now > My.Settings.exdate Then
            Timer1.Stop()
            MsgBox("Expired")
            Dim serial As String
            serial = InputBox("Enter Serial", "Serial", , , )
            If serial = 1234 Then
                My.Settings.registered = True
                Form3.Show()
                Me.Close()
            Else
            End If
        End If
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim serial As String
        serial = InputBox("Enter Serial", "Serial", , , )
        If serial = 1234 Then
            My.Settings.registered = True
            Me.Hide()
            Form3.Show()
        End If
    End Sub
End Class



This is my code for a trial application. The code is pretty basic but what i couldn't figure out was how i would be able to prevent users from changing the date to extend the trial ("error" i would be getting). I am completely lost in how i would be able to manage this problem. Any ideas, codes, or a push in the right direction would be appreciated. Thanks.

Also, i have tried searching for some code to help out with this with no luck, not sure if i missed something?

sorry i had to make a new topic, couldn't edit title to the other one :/ seemed more like a how-to more than a help me
Was This Post Helpful? 0
  • +
  • -

#3 no2pencil  Icon User is online

  • Toubabo Koomi
  • member icon

Reputation: 5303
  • View blog
  • Posts: 27,195
  • Joined: 10-May 07

Re: *HELP* trial app- how to stop users from changing date to extend trial

Posted 08 August 2011 - 11:10 PM

View Postxhaxxor, on 09 August 2011 - 01:52 AM, said:

sorry i had to make a new topic, couldn't edit title to the other one :/ seemed more like a how-to more than a help me


** Topics merged **

Please don't make duplicate topics.
Was This Post Helpful? 0
  • +
  • -

#4 biggerB  Icon User is offline

  • If at first you donít succeed, call it version 1.0
  • member icon

Reputation: 80
  • View blog
  • Posts: 760
  • Joined: 11-June 10

Re: *HELP* trial app- how to stop users from changing date to extend trial

Posted 09 August 2011 - 04:13 AM

This type of applications tend to be a bit tricky.. What you have to do is to count the days remaining till the end of the trial, rather then checking the date each time, you could make a file that contains the number of days remaining in the trial period. When the program starts for the first time, write the number of days the program will stay active into the file, and save the current Date (Only the date, including month and year) into a setting in your program. Then whenever the program starts check to see if the current date is different from the one in your settings, if it is different, then subtract one day from the trial period and keep the current date in the settings. This way, when the user will set the date back in hopes of renewing his trial period, he would just subtract one day from his trial period. Thus he will cry. :P

Hope it helps..

This post has been edited by biggerB: 09 August 2011 - 04:14 AM

Was This Post Helpful? 0
  • +
  • -

#5 Tarkenfire  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 115
  • View blog
  • Posts: 314
  • Joined: 04-May 11

Re: *HELP* trial app- how to stop users from changing date to extend trial

Posted 09 August 2011 - 01:20 PM

If you do what biggerB suggests, do remember you need to make sure the person can't just edit the file and change it, thusly circumventing it.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1