I want to use C # to do a program, enabling prompt trial period, after a trial period prompted to register.
thank.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Aug 24, 2013, 9:26 AM EDT
The first time the application is run this creates and stores the expiry date in a file and, then checks the expiry date against the current date each subsequent time the application is run.
However, you can't just store this file in (say) the application folder because, if you did, the user could simply delete it and restart the trial period. You need to bury it in the file system so that it will be difficult for an ordinary user to find it and the following approach uses 'isolated storage' to achieve that aim:
It will be more secure if you give your assembly a strong name and store it in the GAC. Otherwise, it will be identified by its file path and the user will then be able to defeat the trial period by either renaming or copying it to a different location which will cause the isolated storage to be reset.
However, all limited trial applications which depend on the system clock can be defeated by the user temporarily changing the system date. You can prevent this by obtaining the date from the internet, using a web service or otherwise, but this obviously requires that the user has an internet connection which can cause a number of problems in itself.
A better idea IMO is to restrict the number of times the application can be run without any time restriction. You can then simply update the count in the file on each running.
Jignesh TrivediRank #16 · 50.3K reputationPosted Aug 21, 2013, 7:51 PM EDT
hi,
Please refer our Recommended solution. it might help you.
http://www.c-sharpcorner.com/uploadfile/tanmayit08/make-combination-of-keys-for-our-trial-version-application/
http://msdn.microsoft.com/en-us/library/windows/apps/hh694065.aspx
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Aug 21, 2013, 8:26 PM EDT
refer to this link
http://www.c-sharpcorner.com/uploadfile/tanmayit08/make-your-application-with-trial-version/
http://www.codeproject.com/Articles/15496/Application-Trial-Maker
Ken HRank #2,315 · 610 reputationPosted Aug 23, 2013, 11:16 PM EDT
I just need a simple example Oh. For example, I wanted to be valid for 30 days to write to a binary file, every time you start the program determines whether the current date is greater than 30 days, if more than 30 days then it prompts the user and exit. :)
thank.
Nitesh KejriwalRank #253 · 9.9K reputationPosted Aug 24, 2013, 7:54 PM EDT
Ken HRank #2,315 · 610 reputationPosted Aug 25, 2013, 5:41 PM EDT
if (!isf.FileExists("expiry.txt")) //System.IO.IsolatedStorage.IsolatedStorageFile not include "FileExists" define
VulpesRank #55 · 29.2K reputationPosted Aug 26, 2013, 2:26 AM EDT
To check whether the isolated storage file already exists, try replacing this line:
Ken HRank #2,315 · 610 reputationPosted Aug 26, 2013, 5:46 PM EDT
thanks.
Vengat Yadve5 reputationPosted Sep 13, 2016, 11:27 PM EDT