System.ConsolePal.Beep C# (CSharp) Method

Beep() public static method

public static Beep ( int frequency, int duration ) : void
frequency int
duration int
return void
        public static void Beep(int frequency, int duration)
        {
            if (frequency < MinBeepFrequency || frequency > MaxBeepFrequency)
                throw new ArgumentOutOfRangeException(nameof(frequency), frequency, SR.Format(SR.ArgumentOutOfRange_BeepFrequency, MinBeepFrequency, MaxBeepFrequency));
            if (duration <= 0)
                throw new ArgumentOutOfRangeException(nameof(duration), duration, SR.ArgumentOutOfRange_NeedPosNum);

            Contract.EndContractBlock();
            Interop.Kernel32.Beep(frequency, duration);
        }

Same methods

ConsolePal::Beep ( ) : void

Usage Example

示例#1
0
文件: Console.cs 项目: TelsaV/corefx
 public static void Beep(int frequency, int duration)
 {
     ConsolePal.Beep(frequency, duration);
 }
All Usage Examples Of System.ConsolePal::Beep