Console.Beep Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Plays the sound of a beep through the console speaker.

Namespace:   System
Assembly:  mscorlib (in mscorlib.dll)

[<HostProtectionAttribute(SecurityAction.LinkDemand, UI = true)>]
static member Beep : unit -> unit

Exception Condition
HostProtectionException

This method was executed on a server, such as SQL Server, that does not permit access to a user interface.

By default, the beep plays at a frequency of 800 hertz for a duration of 200 milliseconds.

System_CAPS_noteNote

The Beep method is not supported on the 64-bit editions of Windows Vista and Windows XP.

Beep wraps a call to the Windows Beep function. Whether Beep produces a sound on versions of Windows before Windows 7 depends on the presence of a 8254 programmable interval timer chip. Starting with Windows 7, it depends on the default sound device.

The following example demonstrates the Beep method. The example accepts a number from 1 through 9 as a command line argument, and plays the beep that number of times.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: