Hello friends

i am working in VS2010 C# Windows application,

i have created a application

in which some what like security application

i have added a form1 in which i have included a button ie... button1 and a textbox ie... textbox1

in button1 i have added a code like

private void button1_Click(object sender,EventArgs e)
{
if (textbox1.text=="1234567")
{
  Form f= new Form2();
  this.Hide();
  f.Show();
}
else 
{
messagebox.show("Enter the Correct Licence key");

}

but what i want is this license key(1234567) should work only for one year after one year it should stop working(stop working means it should not display the form2)

what can i do in order to do this

please help me

in this case u should have to save createdtime of license key and each time u have to check it with Current date

or in case u are not using database you can create license key by encrypting date and while u try to open form2 decrypt it and compare it with current date

or in case u are not using database you can create license key by encrypting date and while u try to open form2 decrypt it and compare it with current date

ya i am not using any database
if you don't mind can you explain me the above solution through a code so that i can understand quickly please

Edited 4 Years Ago by skp03: n/a

If you are familiar with the registry, you can add an entry that marks when the license key was first entered. If a year has passed, you can make the program ask for another license key.

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