The simplest thing to do is to check system date on start up.

suppose you want for 30 days from today ---say 25_sep-2011.

in the start up check if the date is less than the above date.

if it is more display an error message.

for a better and full proof solution you need to write into system registry.

Stick with the registry method, for it will allow you to make exe's expire with respect to date or number of trials.

Comments
terrible suggestion. He's a NEW programmer, or did you miss that?

you are the geneus but im still unable to under stand please tell code me for expire
my exe after two days

Do NOT use the registry. As a new programmer you may destroy your system.

As debasisdas said, "The simplest thing to do is to check system date on start up." Which means you need to look up the Date functions in VB. There are at least 2 that will help you.

Comments
I did't see that coming

try this

Dim dtmTest As Date
dtmTest = DateValue(Now)

next you need to compare the date with desired date using DateDiff.

Edited 5 Years Ago by debasisdas: n/a

As I said:

... you need to look up the Date functions in VB. There are at least 2 that will help you.

Do you understand those statements?

This article has been dead for over six months. Start a new discussion instead.