Ejemplo n.º 1
0
        static void Beep(string sound)
        {
            if (ConfigurationManager.AppSettings["sound_enabled"] != "1")
            {
                return;
            }
            var filename = ConfigurationManager.AppSettings[string.Format("sound_{0}", sound)];

            if (filename == "")
            {
                filename = @"\windows\Alarm1.wav";
            }
            CoreDLL.PlaySound(filename, IntPtr.Zero,
                              CoreDLL.PlaySoundFlags.SND_FILENAME | CoreDLL.PlaySoundFlags.SND_ASYNC);
        }