各位大虾,定时5s发出一个声音,用什么控件啊?timer吗?可是他每隔5s都要发出这个声音,一直循环,而我只要一次……

解决方案 »

  1.   

    timer啊  5秒后 叫一次 叫完就关闭掉timer  就不会一直循环了
      

  2.   

     timer1.Enabled = true;启动 不用就 timer1.Enabled = false;  你写在tick事件里面
      

  3.   

    backGroundWorker 可以,或者timer,或者直接用多线程。
      

  4.   

    比如:            Application.DoEvents();
                System.Threading.Thread.Sleep(5000);            string path =@"C:\Windows\winsxs\x86_microsoft-windows-s..-soundthemes-sonata_31bf3856ad364e35_6.1.7600.16385_none_c3f8b73d5a679656";
                System.Media.SoundPlayer Sp = new System.Media.SoundPlayer(path + "\\Windows Ding.wav");
                Sp.Play();
      

  5.   

                Application.DoEvents();
                System.Threading.Thread.Sleep(5000);
                System.Media.SystemSounds.Asterisk.Play();