1

I have developed an App in WPF using C#, now the problem is i want my application as licensed version, for first 30 days it should be free i.e., trial version so now when it completes then it should pop up a window saying that trial is completed activate it in that if user click yes then a window with an email id text box is appeared if email id is given then the product key should be generated and send to the mail id specified .

How to achieve it please help thanks in advance.

  • possible duplicate of [Where can I store (and manage?) Application license information?](http://stackoverflow.com/questions/20676008/where-can-i-store-and-manage-application-license-information) – Adriano Repetti Jun 23 '15 at 06:24

1 Answers1

5

There is no out-of-the-box way of doing this (Though there are SDK's out there that you can buy that do it for you). The general concerns are:

  1. How will you encode the licensable features into a key (or other medium)?
  2. Where will you store this data?
  3. How will you try and avoid tampering with this data?
  4. Write code to disable what you want if they are not licensed

Some options / thoughts on the points are:

  1. Encoding the details into a key can be easy enough if you have a limited number of functions (or just licensed or not). Base32 encoding will generally produce easy to re-key value with a reasonable amount of bits to encode number of users or the like. If you have more data to encode (lots of licensable features) then a "key" can be more problematic. In the past I have used a key that does nothing much other than act as an association to a downloadable xml file, which has very detailed feature breakdown.

  2. Depending on your application you can either store in the file system, registry or database. It could be worth trying the license to something about the system, for example motherboard ID, database details, etc.

  3. My general preference is to use an online activation and digital signatures to ensure data is not tampered with. You can obviously also try and encode the anti-tampering stuff into the key as checksum bits. You also need to concern yourself with people moving their clock back, which you could do something like check an internet time provider every X launches to ensure their time is within X minutes of it for their time-zone. Also whether the current date/time is before the previous launch date/time.

  4. This is entirely up to you. You can show a dialog on launch to push people to your license purchase page. Or (and probably better for conversion but harder to code) is to disable certain (key) features to encourage people to upgrade, but they still have a semi-functional application if not.

With all that said, no matter what you do someone will always find a way to circumvent your licensing if they really want to (Just ask the likes of Microsoft or Adobe). So it is a question of how much time you want to invest in writing clever licensing mechanisms vs. the cost in lost sales from people circumventing it vs. how easy it is for real customers to license you application (as if it is too hard you will turn people off buying).

Hope that helps a little.

Simon Bull
  • 841
  • 6
  • 13