Question: For example, we made a windows form application and converted it to setup. I want the person who installs the program on his computer to run the program only ten times on the computer he has installed, but not the eleventh time. Or in the same way, I want the program to run for ten hours on the computer where the program is installed. Is there a way to do this or is such a thing possible?

Answer: 
In a simple way - you can set a counter of loaded times and save it in Properties.Settings.Default. In Form Load event read counter value from the Settings file and check whenever it is bellow required startup times. If above prevent normal loading. If below increment the counter, save it and proceed with loading. Below sample code:

```
private void Form1_Load(object sender, EventArgs e)
{
    int load_counter;
    load_counter = Properties.Settings.Default.LoadCounter;

    if (load_counter < 10)
    {
        load_counter++;
        Properties.Settings.Default.LoadCounter = load_counter;
        Properties.Settings.Default.Save();

        // Proceed With Normal Loading
    }
    else this.Close(); // Close Application

}

```
Best solution is to make app ask web server whether user has permission to start app again or not - but it requires to make the server in first place ... But without the web server the easiest way to restrict user from using your app is to store value on users PC. The simplest location to store value that determines if app can be started is txt file/user setting/appsetings/config file. But those files can be easily accessed and modified by user. Everyone can open txt file and change value of "remaining-starts" from 0 to 999. The better way would be storing the "remaining-starts" in windows registry but more educated people can access registry too. So next step would be hashing/signing the number value so user can just insert number they like - but it is still something that hacker can do. If your app is really small don't spend more time securing your app than making it. If number of users will be under 20 i think storing the "remaining-starts" in app config file and having simple "if" at begining of your app is enough