要想和系统时间同步,要用Timer这个类:
程序代码:
[[it] 本帖最后由 wxiaoer2008 于 2008-10-9 20:05 编辑 [/it]]
程序代码: public partial class Form1 : Form
{
Timer timer1= new Timer();
public Form1()
{
InitializeComponent();
this.timer1.Enabled = true;
this.timer1.Interval = 200;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
}
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text=DateTime.Now.ToString();//label1自己从右边拉一个
}
}[[it] 本帖最后由 wxiaoer2008 于 2008-10-9 20:05 编辑 [/it]]

开源部落http://www.






