473,699 Members | 2,485 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How can I get the running mode ?

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/ =-

Nov 16 '05 #1
4 1753
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/ =-

Nov 16 '05 #2
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/ =-

Nov 16 '05 #3
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/ =-

Nov 16 '05 #4
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/ =-
> >
> >

Nov 16 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
12278
by: Rex Eastbourne | last post by:
Hi, I'm interested in running a Python interpreter in Emacs. I have Python extensions for Emacs, and my python menu lists "C-c !" as the command to run the interpreter. Yet when I run it I get the message "Spawning Child Process: invalid argument." What do I need to do/download to fix this? I read in a post in this group from a while back where someone had the following lines in his .emacs file:
9
1601
by: **ham | last post by:
"Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services." This is the message I get each time that I want to create an ASP.NET application. The help recommends to register ASP.NET by using the command line and "aspnet_regiis /i" . I do this and there is no error during registration. But again when I try to create an ASP.NET...
9
2999
by: Marina Anufreichik | last post by:
Hi, After deploymnet web application on web server I can access page on local machine and login fine but when I'm trying to access web site from remote machine I can see login page, but when I'm trying to login with correct credentials it give me error: Server Error in '/PDVMgr' Application. ----------------------------------------------------------------------------
7
1472
by: Michael C | last post by:
Hi all, Just started having a problem with the IDE. When I try to 'start' code in the IDE the IDE locks up. It builds and re-builds OK, and I can run the generated EXE outside the IDE, but when I hit the start button the IDE just hangs. This just started happening recently (last few days). I'm not sure if it's something else I installed recently or copying Projects from my laptop to the Desktop and then editing/running them or...
4
15067
by: Claire | last post by:
How do I determine whether Im running in debug or release mode from code please. thanks Claire
7
2575
by: MgGuigg | last post by:
Hello all, This is my first time posting a question to this forum, so here is hoping I am following protocol. I am scraping the rust off my old Basic programming skills, and have just recently upgraded to VB.NET, and I have a lot of catching up to do. That being said, I have come a long way in a short while, however, I am stumped at the moment. I have read through days of posts, but have not been able to address my specific question, so...
0
1546
by: Peter Chant | last post by:
I hope no one minds me running this past them. I'm running a linux machine with with apache, php and mysql. This is not accessable from the internet. I want a server that is visable to the internet. For that purpose I am running a user mode linux machine and using apache on that as the external looking web server. This means that stuff I want to see on the outside is on a copy of apache that is doing little and does not get messed...
4
5237
by: news.citenet.net | last post by:
I keep getting the following error message after my web site running 2 or 3 days I share one folder with about 200 domain names Any one can help? --------------------------------------------------------------------------------
9
7810
by: Michael.Suarez | last post by:
Suppose I have a program that prompts you with a dialogbox to enter a password. If you get the password correct, it allows you into the program, else it kills the program. Suppose that when I am in Visual Studio, running the program in debug mode, i want to bypass the password prompt because if i am the developer, i am definately allowed to use the program. I assumed that I could use the this.DesignMode property while in my main...
9
3267
by: esakal | last post by:
Hello, I'm programming an application based on CAB infrastructure in the client side (c# .net 2005) Since my application must be sequencally, i wrote all the code in the UI thread. my problem occurs when i try to show a progress bar. The screen freezes. I know i'm not the first one to ask about it. but i'm looking
0
8689
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8916
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7752
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5875
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4376
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2348
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2010
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.