Groups | Blog | Home
all groups > vb.net controls > june 2005 >

vb.net controls : How to check expiry date


Olaf Rabbachin
6/27/2005 12:00:00 AM
Hi,

[quoted text, click to view]

try something like this:

Public Shared Function LicenseExpired() As Boolean
'store the expiry-date somewhere rather than hard-coding it, but after
'that it'll be as simple as:
Dim tsCompare As TimeSpan = _
Date.Today.Subtract(New Date(2005, 06, 30))

Select Case tsCompare.Days
Case Is < 0
'There's still days left
Return False
Case 0
'Will expire tomorrow
Return False
Case Else
'Expired
Return True
End Select
End Sub

If you want additional security concerning a changed system-date, store the
installation-date as well and check back on it.

Cheers,
Naga Kiran
6/27/2005 11:42:16 AM
Hi
i want to set expiration date for my web based application. for eg it has
to be worked for 15 days from the date when it was installed.
More over i dont want to use system date to check the
installed date with current date as because any one can easily change the
system date so tha application may work as it is after crossing the 15 days
also.

Can anybody tell me how to do this one.its very urgent for me.

Thanx in advance
Kiran

AddThis Social Bookmark Button