CSharp examples for Language Basics:Preprocessor
Use #if to check flag defined by #define and #undef
#undef STANDARDVERSION/*from w w w . jav a2 s . com*/ #define PROFESSIONALVERSION #undef ENTERPRISEVERSION using System; class BliposExplorer { public static void Main() { #if STANDARDVERSION Console.WriteLine("This is the standard version"); #endif #if PROFESSIONALVERSION Console.WriteLine("This is the professional version"); #endif #if ENTERPRISEVERSION Console.WriteLine("This is the enterprise version"); #endif } }