DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3

Thread: _debug_

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    134

    _debug_

    I have seen this sort of thing in old MFC procgrams in C++ and I wonder what is the comparable way to do this in C#.

    If I want a C# program to run differently in debug mode than in release mode, how do I do it? Don't I use some sort of #ifdef _DEBUG_ command?

  2. #2
    Join Date
    Sep 2008
    Posts
    86
    Code:
    private void SomeMethod()
    {
    #if DEBUG
         textBox1.Text = "Debug Mode";
    #else
         textBox1.Text = "Release Mode";
    #endif
    }

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,649
    This is a good article on the subject.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links