⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mod_timestatus.cs

📁 一个农村管理系统的程序 数据库那部分可能不全 大家可以
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Text;
using System.Timers;

namespace MsgSystem
{

    //this class is used to refresh the status of the time status of the main window,
    //it uses a easy timer, refresh the time every one second

    static class Mod_TimeStatus
    {
        static Timer timeRefresher = null;
        static DateTime timer;
        static string timeString = "";

        public static void ticker(object src, ElapsedEventArgs evt)
        {
            timer = DateTime.Now;
            timeString = timer.Year + " - " + timer.Month + " - " + timer.Day + "      " + timer.Hour + ":" + timer.Minute + ":" + timer.Second;
            Program.main_wnd.setTimeStatus(timeString);

        }

        public static void init()
        {
            timeRefresher = new Timer(100);
            ElapsedEventHandler eeh = new ElapsedEventHandler(ticker);
            timeRefresher.Elapsed += eeh;
            timeRefresher.Start();
        }


    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -