确定是否在IDE中执行的方法? [英] Way to determine whether executing in IDE or not?
本文介绍了确定是否在IDE中执行的方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在 C#/ VB
中 Visual Studio 2010
,代码中是否有办法确定程序是否为目前是否在IDE中运行?
In C#/VB
in Visual Studio 2010
, is there way in the code to determine whether the program is currently running in the IDE or not?
eg. If ProgramRunningInIDE Then MessageBox.Show exc.Message
推荐答案
你可以检查调试器是否附加:
You could check if the debugger is attached with:
System.Diagnostics.Debugger.IsAttached
这基本上做同样的事情。
This essentially does the same thing.
这篇关于确定是否在IDE中执行的方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文