public class WindowHelper
    {
        public static void ShowTime(object userData)
        {
            int oldX = Console.CursorLeft;
            int oldY = Console.CursorTop;

            Console.SetCursorPosition(0, 0);
            Console.Write(DateTime.Now.ToLongTimeString());

            Console.CursorLeft = oldX;
            Console.CursorTop = oldY;
        }
    }

 
    class Program
    {
        static void Main(string[] args)
        {

            System.Threading.Timer clock = new Timer(WindowHelper.ShowTime, null, 0, 1000);
         
            Console.ReadLine();
        }

   }

相关文章:

  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-21
  • 2021-06-06
猜你喜欢
  • 2022-12-23
  • 2021-08-25
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
相关资源
相似解决方案