xTroll,
If you are still looking for an answer, here it is.
A preprocessor directive is performed by the compiler at compile time. The
following snippet works -
#if DEBUG
Console.WriteLi ne("Debug Version!");
#else
Console.WriteLi ne("Release Version!");
#endif
It works because DEBUG is set to true when you compile your app in Debug
mode with VS.NET (think of DEBUG as a variable the compiler uses while
compiling the app. You can define your own compile level variables by the
#define keyword. Such as -
#define pi 3.14
All the compiler does is find all the places where the symbol pi is in your
code (not in string literals though) and replaces it with the literal 3.14.
Hence, DEBUG is replaced with the literal true when compiling in debug mode.
Take care.
--
Nathan
"xTroLL" <xT****@discuss ions.microsoft. com> wrote in message
news:A0******** *************** ***********@mic rosoft.com...
Your solution is very good. I don't really understand what you wrote.
Thanks
xTroLL
"xTroLL" wrote:
I'm already trying that. But it's not that I want.
In my application, I want to get the type of the compilation use to put
it
on a listview
That means : Data application name - Data application value
exemple:
DEBUG - 1.0.882.19234 or RELEASE - 1.0.882.19234
I want that for an About form
PS : Sorry if my english isn't very good
"Peng Jie" wrote:
> Do you mean pre-compiler directive?
>
> #if (DEBUG)
> Log.WriteLine(" blah blah blah");
> #endif
>
> "xTroLL" wrote:
>
> > Hi,
> >
> > I want to get the running mode (DEBUG or RELEASE) of my application ?
> > Somebody can help me ?
> >
> > xTroLL
> >
> >
> > --------------= Posted using GrabIt =----------------
> > ------= Binary Usenet downloading made easy =---------
> > -= Get GrabIt for free from http://www.shemes.com/ =-
> >
> >