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; using System.Media; namespace aLARM_cLOCK { public partial class frmAlarm : Form { public frmAlarm() { InitializeComponent(); } OpenFileDialog opd = new OpenFileDialog(); private void frmAlarm_Load(object sender, EventArgs e) { } private void btnStart_Click(object sender, EventArgs e) { if (txtRoad.Text !="" || txtTime.Text !="") { timer1.Start(); } } private void timer1_Tick(object sender, EventArgs e) { string now = DateTime.Now.ToLongTimeString(); string WantedTime = txtTime.Text; if (now==WantedTime) { SoundPlayer pleyer = new SoundPlayer(); pleyer.SoundLocation = opd.FileName; pleyer.Play(); MessageBox.Show(txtMessage.Text); } } private void btnRoad_Click(object sender, EventArgs e) { opd.Filter = "file of music | '. wav'"; opd.ShowDialog(); txtRoad.Text = opd.FileName; } private void btnStop_Click(object sender, EventArgs e) { timer1.Stop(); } } }
WMPLib.WindowsMediaPlayer wplayer = new WMPLib.WindowsMediaPlayer(); wplayer.URL = "mp3 URL"; wplayer.controls.play();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)