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

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.
 
M

Martin Arvidsson, Visual Systems AB

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
 
A

andy

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.
 
A

Alberto Poblacion

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) ....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top