Hi.
i want to make a trial version of my inventory application on the basis of total executions e.g i want to make my trial application to only execute 5 times and than show a message of application expiry.
how to do that.
thx in advance.
mansoor
How to make trial version on number of executions in CSharp
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Javeed M ShaikhRank #839 · 2.7K reputationPosted Oct 17, 2011, 5:27 AM EDT
You can create registry keys and play with registry using Microsoft.Win32.RegistryKey, following is a simple example:
Microsoft.Win32.RegistryKey key;
key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Counter");
key.SetValue("Counter", "1");
key.Close();
Also keep in mind that you need to encrypt your information before storing in the registry so that no one goes and reset the numbers. You can store this information in a file on your system maintain the same. No matter what you do if user comes to know about this information they will try to play with the data and hack your system. One more way to do this is call a web service from your app to maintain the user app counter, but again connecting to internet just for this might not be ideal.
Please do not forget to mark "Accepted Answer".
raghavendra setty8 reputationPosted Oct 17, 2011, 1:41 AM EDT
mansoor altaf67 reputationPosted Oct 17, 2011, 2:55 AM EDT