There is an array with timers work intervals. Each timer must record these intervals in a text file.
static void Main(string[] args) { int[] timerDelays = { 10000, 15000, 10000 }; foreach (int d in timerDelays) { var timer = new System.Timers.Timer(d); timer.Elapsed += OnTimeout; timer.AutoReset = true; timer.Enabled = true; } Console.Read(); } private static void OnTimeout(Object source, ElapsedEventArgs e) { int[] timerDelays = { 10000, 15000, 10000 }; StreamWriter strwrt = new StreamWriter("C:\\ΠΏΡΠΈΠΌΠ΅Ρ.txt", true); strwrt.WriteLine(timerDelays); Console.WriteLine("ΠΠ°ΠΆΠΌΠΈΡΠ΅ ENTER ΡΡΠΎ Π±Ρ Π²ΡΠΉΡΠΈ ΠΈΠ· ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΡ"); Console.Read(); } Here is my code. Tell me or give another example, please. I have an error when writing to the file.