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

skp03 are asking how u can get the 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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.