Codice PHP:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Media;
namespace Sveglia
{
public partial class Form1:Form
{
string path;
public Form1()
{
InitializeComponent();
}
private void btn_Click(object sender,EventArgs e)
{
ofd.ShowDialog(this);
path=ofd.FileName;
t2.Enabled=true;
}
private void t1_Tick(object sender,EventArgs e)
{
lbl.Text=(DateTime.Now).ToLongTimeString();
}
private void t2_Tick(object sender,EventArgs e)
{
if(txt.Text.Length==5)
{
if((lbl.Text.Split('.')[0])==(txt.Text.Split('.')[0])&&(lbl.Text.Split('.')[1])==(txt.Text.Split('.')[1]))
{
try
{
SoundPlayer sndPing = new SoundPlayer(path);
sndPing.Play();
}
catch(InvalidOperationException Ioe)
{
MessageBox.Show(Ioe.Message);
}
}
}
}
}
}
Ho dovuto metterlo come [php] perchè non sono riuscito a capire come fargli mantenere l'indentatura..