C# .NET - trl - Asked By Priyanka on 27-Jul-11 06:39 AM

how trial period works. if i check date from computer to create trial period then user can easily convert their date and increase the usage of software.then what i have to do??
Anoop S replied to Priyanka on 27-Jul-11 06:44 AM

There are essentially two kinds of piracy you need to worry about. One is casual piracy - users using the software without paying simply because they haven't really thought to pay. The other is deliberate piracy - people who are determined not to pay, and are willing to put real effort into not doing so.

Casual piracy can be handled with what essentially comes down to gentle reminders - activation keys, time limits, etc. Deliberate piracy, on the other hand, essentially can't be prevented. As Sony, Apple, Microsoft, Nintendo, and a number of other companies will tell you, even when you have the benefit of control of the hardware as well as the software, your protection scheme will be broken. And the person breaking it is as likely to be doing it for the sake of a fun challenge as for the desire to get free software. So for a certain demographic, making the protection stronger doesn't discourage them, it does quite the opposite.

Meanwhile all the stuff you do to try and achieve strong protection is driving legitimate users up the wall. Maybe the trip for detecting gerrymandering with the system clock got set off because they changed time zones. Or maybe they had to replace a bad hard drive or CPU or something, and that set off the system cloning mechanism. Or maybe Microsoft changes Windows's default security settings in a way that causes Windows to pop a mess of UAC warnings while your app's in use thanks to it not being friendly to some trick you used to try and hide the file that stores the licensing data. At work we use a commercial solution, and we've discovered that their protection mechanism can trip in ways that, thanks to a bug in the software, can cause the license data to be corrupted, thus locking the user out of the program. Because of the way their system stores that data, its an unrecoverable situation - the customer literally has to choose between not using that software on that computer ever again, and wiping the hard drive. Yes, it's happened multiple times. Yes, we've lost a lot of potential revenue over it. Yes, I get queasy to think of the damage it's caused because we rely primarily on word of mouth and it's generated a whole lot of bad word of mouth. Long story short, the naive paranoia about piracy of earlier years has probably cost me quite a number of sailing vacations in the Caribbean.

And the worst of it is, it's only a problem for legitimate users. Crackers can easily - painfully easily - get around it with the aid of - if it comes to last resorts - a debugger and decompiler. If the software is on a device in the possession of the end user, you might as well start thinking as if your software's already been cracked. It's to the point that there's a cottage industry that has built up around the idea of people cracking software they legitimately own, just to avoid the annoyance of the software protection mechanisms. They'll give you the money, but they'll still crack the software because your copy protection is just that irritating, and just that easy to circumvent. The alternative - and this is the route I've gone - is to just go buy different software that's less annoying, or use free software instead.

So go with the minimum - watch the clock and time out the demo, because you do need to remind your users to send you a check. But don't do it in a way that makes them decide they don't want to give you a check. If your goal is to convert sales, consider this as the most elegant, cost-effective, and efficient system for keeping users from violating your demo period by mucking with the system clock: It's really, really irritating to work with a computer that's got the clock set to the wrong date. And that's just for home users. For (legitimate) businesses, it's not even a feasible option. And anyone who isn't deterred by that is probably a script kiddie who never really had the means to pay for your software in the first place.

Reena Jain replied to Priyanka on 27-Jul-11 06:47 AM
Hi,

The best option to handle trial period is to go for Windows Registry

When your application runs for first time just write one variable into registry with the date and time.

And after that check that registry entry every time your application runs. If the difference between that entry and current date time is 1 month then you can prompt user that trial period is expired.

See this code to read and write into registry;
using System;
// it's required for reading/writing into the registry:
using Microsoft.Win32;   
// and for the MessageBox function:
using System.Windows.Forms;
 
public string Read(string KeyName)
{
  // Opening the registry key
  RegistryKey rk = baseRegistryKey ;
  // Open a subKey as read-only
  RegistryKey sk1 = rk.OpenSubKey(subKey);
  // If the RegistrySubKey doesn't exist -> (null)
  if ( sk1 == null )
  {
  return null;
  }
  else
  {
  try
  {
    // If the RegistryKey exists I get its value
    // or null is returned.
    return (string)sk1.GetValue(KeyName.ToUpper());
  }
  catch (Exception e)
  {
    // AAAAAAAAAAARGH, an error!
    ShowErrorMessage(e, "Reading registry " + KeyName.ToUpper());
    return null;
  }
  }
}
 
  
 
public bool Write(string KeyName, object Value)
{
  try
  {
  // Setting
  RegistryKey rk = baseRegistryKey ;
  // I have to use CreateSubKey
  // (create or open it if already exits),
  // 'cause OpenSubKey open a subKey as read-only
  RegistryKey sk1 = rk.CreateSubKey(subKey);
  // Save the value
  sk1.SetValue(KeyName.ToUpper(), Value);
 
  return true;
  }
  catch (Exception e)
  {
  // AAAAAAAAAAARGH, an error!
  ShowErrorMessage(e, "Writing registry " + KeyName.ToUpper());
  return false;
  }
}

Hope this will help you
Kalit Sikka replied to Priyanka on 27-Jul-11 06:47 AM
Yes, Its right that you can use the trial versions of most of the softwares by changing the date, but it is possible for personal use only. Professional can't work by setting system date back by day or more. Other softwares and functionality will get effected by this like: Calenders and reminders in outlooks that are very important for the professional along with this outlook supported office communicator that is also get effected by changing date.

So it is not advisable for professionals to use trial version like this
Jitendra Faye replied to Priyanka on 27-Jul-11 06:53 AM

Write a registry key during your installation. The key will contain the date of the installation. The date in the registry key must be encrypted.

When your application is started, check for the existence of this registry key. If it does not exist close the application else decrypt the date, check the trial period and close the application if the trial is over.

dipa ahuja replied to Priyanka on 27-Jul-11 07:01 AM
Hi.. if you are selling your software then provide them a registration code pair..

like create a list of code/key pair in your side and now when ever you sell your project give them a code , and the pair of that code they will get only if they buy the software from you..

so when the person by software from you then give the key realated to that code and using this key allow users to register the code. Like we find in most softwares that is using the "Serial number of software"
Radhika roy replied to Priyanka on 27-Jul-11 09:52 AM
The simplest solution (and as a result the simplest to circumvent) is to store the date the program is first installed (or run) in a file and then check that against the current date whenever the program is launched. If the difference is > 30 days then exit the program.

By storing the date in more obscure places or places that are harder for the user to tamper with (such as the registry) then it gets progressively harder for them to circumvent the system and get more time to use it, but doesn't stop them rewinding the clock on their PC.

If you store the date on your server and also get the date from your server then this is more secure, but does mean that the user has to have an open internet connection to use your software.


 Hope this will help you.