How many times program has run? C#

前端 未结 9 770
情歌与酒
情歌与酒 2020-12-17 02:26

How can I get the number of times a program has previously run in C# without keeping a file and tallying. If it is not possible that way, can it be gotten from the Scheduled

相关标签:
9条回答
  • 2020-12-17 02:45
    int x = Your_Project.Properties.Settings.Default.Counter;
    x++;
    Your_Project.Properties.Settings.Default.Counter = x;
    Your_Project.Properties.Settings.Default.Save();
    
    0 讨论(0)
  • 2020-12-17 02:46

    No, task manager does not provide that kind of information. I wouldn't be hard to create a script that would update a tally and then execute the application and then set up the task to call the script.

    0 讨论(0)
  • 2020-12-17 02:49

    Here is a tutorial for registry handling -- C# Registry Basics

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