Beep.cs 574 B

12345678910111213141516
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Runtime.InteropServices;
  6. namespace Core.Mes.Client.Comm.Tool
  7. {
  8. public class BeepHelper
  9. {
  10. /// <param name="iFrequency">声音频率(从37Hz到32767Hz)。在windows95中忽略</param>
  11. /// <param name="iDuration">声音的持续时间,以毫秒为单位。</param>
  12. [DllImport("Kernel32.dll")] //引入命名空间 using System.Runtime.InteropServices;
  13. public static extern bool Beep(int frequency, int duration);
  14. }
  15. }