資源簡介
C# 使用Timer控件顯示當前時間!
值得下載看看!資源免費,大家分享!!
更多免費資源 http://ynsky.download.csdn.net/

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Windows.Forms;
//Download?by?http://www.codefans.net
namespace?Case10_11
{
????public?partial?class?Form1?:?Form
????{
????????public?Form1()
????????{
????????????InitializeComponent();
????????}
????????private?void?timer1_Tick(object?sender?EventArgs?e)
????????{
????????????this.label1.Text?=?“當前時間是:?“?+?DateTime.Now.Hour.ToString()?+“:“?+?DateTime.Now?.Minute?.ToString?()?+“:“?+DateTime?.Now?.Second?.ToString?()?;
????????}
????????private?void?Form1_Load(object?sender?EventArgs?e)
????????{
????????????this.timer1.Enabled?=?true;
????????}
????????private?void?Form1_DoubleClick(object?sender?EventArgs?e)
????????{
????????????this.Close();
????????????Application.Exit();?
????????}
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
-----------?---------??----------?-----??----
????????????????46496????????????????????16
- 上一篇:ASP.NET,對js文件進行讀寫
- 下一篇:六種加密算法的C#實現源碼
評論
共有 條評論