.Net WinForm 系统在 64 位操作系统上发出蜂鸣声 [英] .Net WinForm System Beep on a 64 Bit OS
问题描述
我的应用程序需要在验证失败时发出哔哔声,以便用户(可能在几英尺之外)可以听到它.我想使用 Console.Beep()
但这是 在 x64 环境中不可用(请参阅备注).计算机中/上可能有也可能没有扬声器,所以我不能使用 System.Media.SystemSounds.Beep.Play()
.
My application needs to beep when validation fails so the user (who may be several feet away) may hear it. I'd like to use the Console.Beep()
but this is unavailable in a x64 environment (see the remarks). There may or may not be speakers in/at the computer, so I can't use System.Media.SystemSounds.Beep.Play()
.
当前的目标平台是 x86 环境,但我希望应用程序也能够在 x64 中运行.
The current target platform is a x86 environment, but I'd like to have the ability for the application to run in x64 also.
有没有办法做到这一点,还是我应该放弃?
Is there a way to do this or should I just give up?
编辑:添加了方法链接.
推荐答案
Beep 已作为本机功能从所有 x64 平台中删除(因此当然没有托管版本),有一个 Microsoft Connect 问题请求退回它.
Beep has been removed as a native function from all x64 platforms (so no managed version of course), there was a Microsoft Connect issue that petitioned to return it.
我们使用不同的技巧来发现服务器,我们远程弹出 DVD 驱动器,托盘打开的驱动器就是我们正在寻找的驱动器 :)
We use a different trick to discover servers, we remote eject the dvd drive, and the drive with the tray open is the one were looking for :)
拉里·奥斯特曼 (Larry Osterman) 对此发表了一篇很棒的文章:Windows 7 中的哔声驱动程序是怎么回事
这篇关于.Net WinForm 系统在 64 位操作系统上发出蜂鸣声的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!