winfrom 窗体定时关闭

public Form1()
{
InitializeComponent();


tmr = new System.Windows.Forms.Timer();
tmr.Tick += delegate {
this.Close();
};

//分钟为单位  10 分钟
tmr.Interval = (int)TimeSpan.FromMinutes(10).TotalMilliseconds;
tmr.Start();
}

posted @ 2022-12-28 09:54  djx359  阅读(127)  评论(0)    收藏  举报