How to make a WPF application a 30 day trial version, and make it licensed using product key?

前端 未结 1 1618
野的像风
野的像风 2021-01-24 23:53

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 com

相关标签:
1条回答
  • 2021-01-25 00:20

    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.

    0 讨论(0)
提交回复
热议问题