Visual Studio 2008 在调试时出错时播放声音
我正在调试一个长时间运行的进程(40 分钟以上)。我不想在调试时全神贯注于我的工作站。我希望 VS 能够在发生异常时播放声音,以将我的注意力拉回工作站,以便我可以解决问题并继续前进。
这可能吗?
I have a long running process (40+ min) that I am debugging. I don't want to have to give my workstation my full attention while I'm debugging. I'd like if VS could play a sound if an exception occurs to pull my attention back to my workstation so I can resolve the issue and move on.
Is this possible?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于控制面板的声音小程序中的所有不同事件,我认为应该涵盖这一点。
您只需要弄清楚在异常时弹出的消息框将播放哪一个。可能是“关键停止”。
顺便说一句,Visual Studio 还在其中添加了“断点命中”声音事件,以及与构建有关的事件。
With all the different events in the Sounds applet of the Control Panel, I think this should be covered.
You just need to figure out which one will get played for the message box that pops up on an exception. Probably "Critical Stop."
As an aside, Visual Studio also adds a "Breakpoint hit" sound event in there, too, as well as events having to do with a build.
好吧,您可以做正确的事情并将 try/catch 块添加到您的代码中。然后,如果发生异常,您可以在 catch 块中以编程方式播放声音。这将带来额外的好处,即在您的应用程序中实现真正的错误处理。
Well, you could do the righteous thing and add try/catch blocks to your code. Then, if an exception occurs, you could play a sound programmatically in the catch block. This will have the additional benefit of leading to real error handling in your APP.