using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Media;
namespace 闹钟2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
label1.Text = DateTime.Now.ToString();
timer1.Start();
}
bool b = false;
int i, j;
private void timer1_Tick(object sender, EventArgs e)
{
label1.Text = DateTime.Now.ToString();
if (b==false)
{
if (i==DateTime.Now.Hour)
{
if (j==DateTime.Now.Minute)
{
b = true;
SoundPlayer sound = new SoundPlayer();
sound.SoundLocation = "shengpizi.wav";
sound.Play();
}
}
}
}
private void button1_Click(object sender, EventArgs e)
{
b = false;
i = int.Parse(comboBox1.Text);
j = int.Parse(comboBox2.Text);
}
}
}