正在运行的程序如何知道它是否在IDE中 [英] How can a running program know if it's in the IDE

查看:77
本文介绍了正在运行的程序如何知道它是否在IDE中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在VB6中,我曾经检查过应用程序文件,如果是VB6,我知道我在

IDE中。


我想我可以算一下如何在dotnet上做同样的事情,但我想知道是否有更好的方法来判断一个程序是在IDE中运行还是单独作为
运行。有吗?


Cal

解决方案

试试这个:


--------------------------


System.Diagnostics.Debugger.IsAttached


--------------------------


它应该返回当附加调试器时(在Vis

Studio IDE中运行时)为true。


希望这有帮助,


Trev。


"活性" <交流**** @ REMOVEa-znet.com>在消息中写道

新闻:uE ************* @ TK2MSFTNGP11.phx.gbl ...

在VB6中,我曾经检查过应用程序文件,如果它是VB6,我知道我在
IDE中。

我想我可以弄清楚如何在dotnet上做同样的事情,但我想知道是否
那里不是确定程序是在IDE
中运行还是作为独立运行的更好方法。有吗?

Cal



关闭。适用于开始但不是开始没有调试


谢谢


" Codemonkey" <胡********* @ hotmail.com>在消息中写道

新闻:%2 **************** @ tk2msftngp13.phx.gbl ...

试试这个:

--------------------------

System.Diagnostics.Debugger.IsAttached

--------------------------

调试器时它应该返回true附件(在
Vis Studio IDE中运行时)。

希望这会有所帮助,

Trev。

"活性" <交流**** @ REMOVEa-znet.com>在消息中写道
新闻:uE ************* @ TK2MSFTNGP11.phx.gbl ...

在VB6中我曾经检查过app文件如果它是VB6,我知道我在
IDE中。

我想我可以弄清楚如何在dotnet上做同样的事情,但我想知道
如果有没有更好的方法来确定程序是否在IDE中运行


作为独立程序。有吗?

Cal




"活性" <交流**** @ REMOVEa-znet.com> schrieb

关闭。适用于开始但不是开始没有调试



为什么只关闭? 无需调试即可启动意味着*没有附上*调试器。

-

Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


In VB6 I used to check the app file and if it was VB6 I knew I was in the
IDE.

I suppose I could figure out how to do the same on dotnet but I wonder if
there isn''t a better way to determine if a program is running in the IDE or
as standalone. Is there?

Cal

解决方案

Try this:

--------------------------

System.Diagnostics.Debugger.IsAttached

--------------------------

It should return true when the debugger is attached (when running in the Vis
Studio IDE).

Hope this helps,

Trev.

" active" <ac****@REMOVEa-znet.com> wrote in message
news:uE*************@TK2MSFTNGP11.phx.gbl...

In VB6 I used to check the app file and if it was VB6 I knew I was in the
IDE.

I suppose I could figure out how to do the same on dotnet but I wonder if
there isn''t a better way to determine if a program is running in the IDE or as standalone. Is there?

Cal



Close. Works for "Start" but not for "Start without debugging"

Thanks

"Codemonkey" <hu*********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...

Try this:

--------------------------

System.Diagnostics.Debugger.IsAttached

--------------------------

It should return true when the debugger is attached (when running in the Vis Studio IDE).

Hope this helps,

Trev.

" active" <ac****@REMOVEa-znet.com> wrote in message
news:uE*************@TK2MSFTNGP11.phx.gbl...

In VB6 I used to check the app file and if it was VB6 I knew I was in the IDE.

I suppose I could figure out how to do the same on dotnet but I wonder if there isn''t a better way to determine if a program is running in the IDE


or

as standalone. Is there?

Cal




" active" <ac****@REMOVEa-znet.com> schrieb

Close. Works for "Start" but not for "Start without debugging"


Why only close? "Start without debugging" means *no* debugger is attached.
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


这篇关于正在运行的程序如何知道它是否在IDE中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆