How to beep using PC speaker?

后端 未结 3 1880
挽巷
挽巷 2021-01-02 13:06

I want to make a beep sound using PC speaker in C#. When using the following code:

[DllImport(\"kernel32.dll\", EntryPoint = \"Beep\", SetLastError = true,
E         


        
3条回答
  •  耶瑟儿~
    2021-01-02 13:51

    You can use SystemSounds.Beep for example: SystemSounds.Beep.Play();

    See also: SystemSounds.Beep Property

提交回复
热议问题