时间闹钟c#源代码文档

时间:2014-12-22 05:23:13
【文件属性】:

文件名称:时间闹钟c#源代码文档

文件大小:316KB

文件格式:DOC

更新时间:2014-12-22 05:23:13

时间闹钟,C#

c#时间闹钟的源代码 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; namespace b35 { public partial class Form1 : Form { bool flag=false ; DateTime mytime; public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { this.label1.Text = Convert.ToString(DateTime.Now); if (( DateTime.Now == mytime ) && (flag ==true )) this.axWindowsMediaPlayer1.URL = @"d:\Hello.wav"; } private void button1_Click(object sender, EventArgs e) { if ((textBox1.Text) == "") { MessageBox.Show("请输入定时时间"); } else { flag = true; mytime = Convert.ToDateTime(textBox1.Text); this.Text = mytime.ToString(); } } private void Form1_Load_1(object sender, EventArgs e) { timer1.Interval = 1000; this.label1.Text = Convert.ToString(DateTime.Now); } } }


网友评论