Results 1 to 3 of 3

Thread: Help Me Is't Correct Codes for 60 Days Validation for Application

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2010
    Location
    TamilNadu, India
    Posts
    249

    Smile Help Me Is't Correct Codes for 60 Days Validation for Application

    Hello
    i am creating a class for only 60 days working my application but i don't know that is correct code,
    please help me
    Thanks....

    Code:
    Public Class ClassTrialVersion
     Implements IDisposable
    
    #Region "Constructor"
        Public _onceCatchTrailExpiredMsg As Boolean = False
        Public Sub New(ByVal _softwareInitialDate As Date)
            Try
                Dim _msgs$ = Nothing
                Dim _ethanaiYeariruku% = 0
                Dim _ethanaiMonthIruku% = 0
                Dim _ethanaiDaysIruku% = 0
    
                '------------------YearCompare----------------------------------
                'Rendu Date kkum Ethanai YEAR difference ikku nnu check pannrean
                _ethanaiYeariruku% = DateDiff(DateInterval.Year, _softwareInitialDate, Now.Date) '1 Year iruntha Ok [Dec2010 - Jan2011]
                Select Case _ethanaiYeariruku
                    Case Is < 0 'Year
                        _onceCatchTrailExpiredMsg = True
                        _msgs$ = "Trial Expired" & vbCrLf & "Please Purchase this Software : #10001"
                        MsgBox(_msgs$, MsgBoxStyle.Critical, "Beta Test")
                        End
                    Case Is > 1 'Year
                        _onceCatchTrailExpiredMsg = True
                        _msgs$ = "Trial Expired" & vbCrLf & "Please Purchase this Software : #10002"
                        MsgBox(_msgs$, MsgBoxStyle.Critical, "Beta Test")
                        End
    
                    Case 0, 1 'Year
                        'Months
                        _ethanaiMonthIruku% = DateDiff(DateInterval.Month, _softwareInitialDate, Now.Date) '1 Year iruntha Ok [Dec2010 - Jan2011]
                        Select Case _ethanaiMonthIruku
                            Case Is < 0 'month if minus value
                                _onceCatchTrailExpiredMsg = True
                                _msgs$ = "Trial Expired" & vbCrLf & "Please Purchase this Software : #10003"
                                MsgBox(_msgs$, MsgBoxStyle.Critical, "Beta Test")
                                End
                            Case Is >= 2 'month
                                _ethanaiDaysIruku = DateDiff(DateInterval.Day, _softwareInitialDate, Now.Date) '1 Year iruntha Ok [Dec2010 - Jan2011]
                                If _ethanaiDaysIruku > 60 Then
                                    _onceCatchTrailExpiredMsg = True
                                    _msgs$ = "Trial Expired" & vbCrLf & "Please Purchase this Software : #10004"
                                    MsgBox(_msgs$, MsgBoxStyle.Critical, "Beta Test")
                                    End
                                End If
                        End Select
                        'Days
                        _ethanaiDaysIruku% = DateDiff(DateInterval.Day, _softwareInitialDate, Now.Date) '1 Year iruntha Ok [Dec2010 - Jan2011]
                        Select Case _ethanaiDaysIruku%
                            Case Is < 0
                                _onceCatchTrailExpiredMsg = True
                                _msgs$ = "Trial Expired" & vbCrLf & "Please Purchase this Software : #10005"
                                MsgBox(_msgs$, MsgBoxStyle.Critical, "Beta Test")
                                End
                            Case Is > 60 'days
                                _onceCatchTrailExpiredMsg = True
                                _msgs$ = "Trial Expired" & vbCrLf & "Please Purchase this Software : #10006"
                                MsgBox(_msgs$, MsgBoxStyle.Critical, "Beta Test")
                                End
                        End Select
                End Select
    
    
                Dim _methamullaDathi% = 60 - DateDiff(DateInterval.Day, _softwareInitialDate, Now.Date)
                ' MsgBox("Days Remaining : " & 60 - _methamullaDathi%) '1 Year iruntha Ok [Dec2010 - Jan2011]
                If _methamullaDathi < 0 Then
                    _onceCatchTrailExpiredMsg = True
                    _msgs$ = "Trial Expired" & vbCrLf & "Please Purchase this Software : #10007"
                    MsgBox(_msgs$, MsgBoxStyle.Critical, "Beta Test")
                    End
                End If
    
            Catch ex As Exception
                MsgBox(ex.ToString)
            End Try
        End Sub
    
    End Class
    
    
     Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim _clsTrialInitialize As New ClassTrialVersion(dtpck1.Value.Date)
        End Sub

  2. #2
    Frenzied Member
    Join Date
    Jan 2010
    Location
    Connecticut
    Posts
    1,687

    Re: Help Me Is't Correct Codes for 60 Days Validation for Application

    Test it. Install it then advance the date.
    VB6 Library

    If I helped you then please help me and rate my post!
    If you solved your problem, then please mark the post resolved

  3. #3
    Powered By Medtronic dbasnett's Avatar
    Join Date
    Dec 2007
    Location
    Jefferson City, MO
    Posts
    9,897

    Re: Help Me Is't Correct Codes for 60 Days Validation for Application

    @med - you do know that this won't stop anyone who wants to bypass / disable your checks.
    My First Computer -- Documentation Link (RT?M) -- Using the Debugger -- Prime Number Sieve
    Counting Bits -- Subnet Calculator -- UI Guidelines -- >> SerialPort Answer <<

    "Those who use Application.DoEvents have no idea what it does and those who know what it does never use it." John Wein

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
  •  



Click Here to Expand Forum to Full Width