C#时间实时刷新
public Form1()
{
InitializeComponent();
new System.Threading.Thread(() =>
{
while (true)
{
try { label1.BeginInvoke(new MethodInvoker(() => label1.Text = DateTime.Now.ToString())); }
catch { }
System.Threading.Thread.Sleep(1000);
}
})
{ IsBackground = true }.Start();
}