22/02/2009, 17:49
Wav dosyası çalmak için metod.
private void PlaySound(string filename, int flags)
{
try
{
PlaySound(filename, 0, flags); // extern PlaySound'u çağır }
catch(Exception e)
{
string errorMsg = " Ses calarken hata:
" + filename + "
" + "
Stack Trace:
" + e.StackTrace + "
";
MessageBox.Show(errorMsg, "hata", MessageBoxButtons.OK, MessageBoxIcon.Stop);
App.Terminate();
}
}
[DllImport("winmm.dll")]
public static extern void PlaySound(string filename, int module, int flags);
}
kullanımı:
PlaySound("dong.wav",0x0001);
Alper Kalaycıoğlu
private void PlaySound(string filename, int flags)
{
try
{
PlaySound(filename, 0, flags); // extern PlaySound'u çağır }
catch(Exception e)
{
string errorMsg = " Ses calarken hata:
" + filename + "
" + "
Stack Trace:
" + e.StackTrace + "
";
MessageBox.Show(errorMsg, "hata", MessageBoxButtons.OK, MessageBoxIcon.Stop);
App.Terminate();
}
}
[DllImport("winmm.dll")]
public static extern void PlaySound(string filename, int module, int flags);
}
kullanımı:
PlaySound("dong.wav",0x0001);
Alper Kalaycıoğlu