fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. Button[] buttons= new [] { btnA, btnB, btnC, btnD };
  6. int seq=0;
  7. Timer timer;
  8. public static void Main()
  9. {
  10. timer = new Timer();
  11. timer.Tick +=(s,e)=>
  12. {
  13. seq%= 4;
  14. buttons[seq++].Click();
  15. };
  16. timer.Interval = 5000;
  17. timer.Start();
  18.  
  19. }
  20.  
  21.  
  22. void Cancel_Click(object sender, EventArgs e)
  23. {
  24. timer?.Stop();
  25. }
  26.  
  27. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(5,2): error CS0246: The type or namespace name `Button' could not be found. Are you missing an assembly reference?
prog.cs(7,2): error CS0246: The type or namespace name `Timer' could not be found. Are you missing `System.Threading' or `System.Timers' using directive?
Compilation failed: 2 error(s), 0 warnings
stdout
Standard output is empty