none
Create Trial Version Software in Vb.net RRS feed

  • Question

  • Hi,

      I had searched many examples related to trail version making using dot net.But most of them are related to days.Which is ok,but when user changes the system date.Then in that case how can you manipulate day checking?.Which always causes problems in making trial version software.Provide a better solution for making trial version software in vb.net with an example.

    Thursday, November 29, 2018 7:42 AM

Answers

  • Hi,

      I had searched many examples related to trail version making using dot net.But most of them are related to days.Which is ok,but when user changes the system date.Then in that case how can you manipulate day checking?.Which always causes problems in making trial version software.Provide a better solution for making trial version software in vb.net with an example.

    Hi,

    I will give you a good example it helped me to solve this issue

    This is the code and you will need to have ApplicationEnhancement.ddl file ,I will send you the link

    Imports ApplicationEnhancement.Expiry
    
    Public Class Form1
        Private WithEvents usage As ApplicationUsage
        Private _maxTimes As Integer = 5
        Private _usageLimitExceeded As Boolean = False
    
    
    
        Private Sub _
            Form1_Load(sender As System.Object, _
                       e As System.EventArgs) _
                       Handles MyBase.Load
    
            ' Initialize the variable "usage" by using
            ' the NEW keyword along with the number
            ' of maximum "hits" you want to allow:
            usage = New ApplicationUsage(_maxTimes)
    
    
    
            ' Now check the usage. If the usage has been
            ' exceeded, the "MaximumExceeded" event will
            ' be raised:
            usage.CheckUsage()
    
    
    
            If _usageLimitExceeded Then
                MessageBox.Show(String.Format("The maximum usage of {0:n0} times has been exceeded.", _
                                              _maxTimes), "Cannot Continue")
    
                Close()
            Else
                ' Just for demonstration here, if the
                ' maximum has not been exceeded then
                ' I'll just show the quantity of times
                ' this program has been run.
    
                MessageBox.Show(String.Format("Usage Quantity: {0:n0}", _
                                                     usage.UsageQuantity))
            End If
    
        End Sub
    
    
    
        Private Sub _
            Form1_FormClosing(sender As Object, _
                              e As System.Windows.Forms.FormClosingEventArgs) _
                              Handles Me.FormClosing
    
            If e.CloseReason = CloseReason.UserClosing Then
                usage.Save()
            End If
    
        End Sub
    
    
    
        Private Sub _
            usage_MaximumExceeded(sender As Object, _
                                  e As System.EventArgs) _
                                  Handles usage.MaximumExceeded
    
            _usageLimitExceeded = True
    
        End Sub
    End Class

    Take a look at this thread 

    hope it helps ....... any question about how to use it in the thread or feel free to ask me 

      

    Regards From Amr_Aly

    Thursday, November 29, 2018 10:08 AM

All replies

  • Hi,

      I had searched many examples related to trail version making using dot net.But most of them are related to days.Which is ok,but when user changes the system date.Then in that case how can you manipulate day checking?.Which always causes problems in making trial version software.Provide a better solution for making trial version software in vb.net with an example.

    Hi,

    I will give you a good example it helped me to solve this issue

    This is the code and you will need to have ApplicationEnhancement.ddl file ,I will send you the link

    Imports ApplicationEnhancement.Expiry
    
    Public Class Form1
        Private WithEvents usage As ApplicationUsage
        Private _maxTimes As Integer = 5
        Private _usageLimitExceeded As Boolean = False
    
    
    
        Private Sub _
            Form1_Load(sender As System.Object, _
                       e As System.EventArgs) _
                       Handles MyBase.Load
    
            ' Initialize the variable "usage" by using
            ' the NEW keyword along with the number
            ' of maximum "hits" you want to allow:
            usage = New ApplicationUsage(_maxTimes)
    
    
    
            ' Now check the usage. If the usage has been
            ' exceeded, the "MaximumExceeded" event will
            ' be raised:
            usage.CheckUsage()
    
    
    
            If _usageLimitExceeded Then
                MessageBox.Show(String.Format("The maximum usage of {0:n0} times has been exceeded.", _
                                              _maxTimes), "Cannot Continue")
    
                Close()
            Else
                ' Just for demonstration here, if the
                ' maximum has not been exceeded then
                ' I'll just show the quantity of times
                ' this program has been run.
    
                MessageBox.Show(String.Format("Usage Quantity: {0:n0}", _
                                                     usage.UsageQuantity))
            End If
    
        End Sub
    
    
    
        Private Sub _
            Form1_FormClosing(sender As Object, _
                              e As System.Windows.Forms.FormClosingEventArgs) _
                              Handles Me.FormClosing
    
            If e.CloseReason = CloseReason.UserClosing Then
                usage.Save()
            End If
    
        End Sub
    
    
    
        Private Sub _
            usage_MaximumExceeded(sender As Object, _
                                  e As System.EventArgs) _
                                  Handles usage.MaximumExceeded
    
            _usageLimitExceeded = True
    
        End Sub
    End Class

    Take a look at this thread 

    hope it helps ....... any question about how to use it in the thread or feel free to ask me 

      

    Regards From Amr_Aly

    Thursday, November 29, 2018 10:08 AM
  • Here is the Link ApplicationEnhancement.ddl to add reference to your project ......

    This example makes your project count number of how many time is open ? , That's mean you will control to make your client open your app. 5 times, 10 times , or whatever only and then he will never be able to open it again ...................


    Regards From Amr_Aly

    Thursday, November 29, 2018 10:23 AM
  • hi,

    I cannot download the dll file from the above link

    Thursday, November 29, 2018 10:55 AM
  • hi,

    I cannot download the dll file from the above link

    The link works well Here or 

    try this link (https://mega.nz/#!bwtEDArQ!dR9wyPv5nfsiUlwJ8nRbUXuPoZGesGhAe7ZMtE3KmHI) copy and paste it ......

    if you can't download it, send me your email to share it with you ............


    Regards From Amr_Aly

    Thursday, November 29, 2018 12:05 PM
  • my emailid -> muralee.raman@gmail.com
    Friday, November 30, 2018 4:38 AM
  • my emailid -> muralee.raman@gmail.com
    I shared it with you ..........

    Regards From Amr_Aly

    Friday, November 30, 2018 9:38 AM
  • Thank you sir
    Friday, November 30, 2018 10:05 AM
  • Thank you sir

    You are welcome ...  But you must take care about if you have a button to close your Application "End" or "Application.ExitThread" is not enough you must put "Close" instead , To ensure that the counter in the formclosing works well 

     If e.CloseReason = CloseReason.UserClosing Then
                usage.Save()
            End If

    Hope this example helps you ............

      

    Regards From Amr_Aly

    Friday, November 30, 2018 12:33 PM