Hello

everybody

i have created a application

in application i have added a form1 and i have used two buttons, when i click(Triggered) button1 it will load form2 and when i click(triggered) button2 it will load form3

but my problem is this form2 and form3 should load when button1 and button2 is clicked but this should work only for one year,

after one year even i clicked the button1 and button2 the form2 and form3 should not load

i got a hint from one of my friend he said that "we need to compare the date when the application is published with the current date if it has crossed 1 year form should not be loaded mean to say even after clicking button after one year the form should not get loaded "

when the system date is changed then it will work form first

i'll explain you in details

see a client has taken for one year ok

but the problem is when the client changes his sytem date than he can use for more than one year right so how to do it

and he has no internet facility also

please explain me with the help of code


but i am not understanding how to proceed


please help me out

Recommended Answers

All 3 Replies

This is the same problem you are dealing with in your other post.
...or at least it can be.

I, personally would make an entry in the registry that tells the date the program was installed (or published) and then compare that to the current date.

It really depends on your intention, first.
Do you want to ALWAYS have the program disabled after a year if its publishing or after a year of it being installed?

If you are unfamiliar with the published date construct, you can ALWAYS just pick a date in the future and not let it work after that date.

This is the same problem you are dealing with in your other post.
...or at least it can be.

I, personally would make an entry in the registry that tells the date the program was installed (or published) and then compare that to the current date.

It really depends on your intention, first.
Do you want to ALWAYS have the program disabled after a year if its publishing or after a year of it being installed?

If you are unfamiliar with the published date construct, you can ALWAYS just pick a date in the future and not let it work after that date.

ya your right can you just get me this done through a piece of code

please if you don't mind

The problem is that USING a piece of code that will do this for you will be as complex as writing it yourself. How would you plan to implement or maintain it?

I have attached a class that handles a License-Key of sorts.
It will create one, let you test it and store it in the registry and retrieve it from the registry.

Consider this code you found laying on the street. You can use it for reference, but if you decide to let it modify your registry, you assume all responsibility.

Here is some sample code that uses the class:

using System;

namespace DW_416523_CS_CON
{
   using SimpleLicenseKey;

   class DW_416523_CS_CON
   {
      static void Main(string[] args)
      {
         CSimpleLicenseKey lk = new CSimpleLicenseKey("Stone2Ware", "DW_416523_CS_CON");
         string strLicenseTest = lk.GetLicenseKey();
         //string strTestKey = lk.GenerateLicenseKey(); //used for testing a new key

         while (!lk.IsValidLicenseKey(strLicenseTest))
         {
            // Run registration routine;
            
            Console.Write("Enter License Key: ");

            strLicenseTest = Console.ReadLine();
            if (!CSimpleLicenseKey.rxKey.IsMatch(strLicenseTest))
            {
               Console.WriteLine("Not valid");
               strLicenseTest = "";
               continue;
            }

            // Key is right pattern.  Might not be valid
            lk.WriteLicenseKey(strLicenseTest);
         }
      }
   }
}
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.