Q: Is there a way to determine if program is executed under Studio IDE?

  • Thread starter Thread starter Niu Kun
  • Start date Start date
N

Niu Kun

My solution is to set a unique name for the program main form.
And then you can list all the programs currently running and see if
there's one title the same to yours.
 
Hi!

I am creating an applications that executes crystal reports.

When developing i want the reports to be read from a certain folder and when
the program is not executed i want to use the Application.StartupPath.

Is there any chans this can be done?

Regards
Martin
 
Hi!

I am creating an applications that executes crystal reports.

When developing i want the reports to be read from a certain folder and when
the program is not executed i want to use the Application.StartupPath.

Is there any chans this can be done?

Regards
Martin

I can think of two simple ways.

1) Conditional compilation - although you have to set a variable.
2) Check what the app startuppath is and develop from a specific
folder.
 
Martin Arvidsson said:
When developing i want the reports to be read from a certain folder and
when the program is not executed i want to use the
Application.StartupPath.

Is there any chans this can be done?

If you always start the program with debugging enabled while you are
running under the VS IDE, you can use this:

using System.Diagnostics;
...
if (Debugger.IsAttached) ....
 
Back
Top