Answer the question
In order to leave comments, you need to log in
How to create a program launch counter inside the program itself (inside the class field)?
static class Program{
static const Count=0;
static void Main(){
// ..... что-то сложное
}
Answer the question
In order to leave comments, you need to log in
Select any available storage.
Cloud
Stream
registry in file
You can use a property that will save your value in Settings.settings
1. Create a parameter and value in Settings.settings
2. Create a class, for convenience - static, import using yourNamespace.Properties;
it so that you can use it Settings.Default
and create a property there:
public static int Count
{
get
{
return (int)(Settings.Default["count"]);
}
set
{
Settings.Default["count"] = value;
Settings.Default.Save();
}
}
YourStaticClass.Count = ++YourStaticClass.Count;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question