Preprocessing commands are mainly used to influenceProgramTo provide the compilation information or prohibited part.CodeC # does not have the same independent pre-processor as C ++, and the pre-processing commands are also processed by the compiler.
1. # define, # UNDEF is used to declare or delete symbol definitions. # define and # UNDEF must be placed in the first line of the file, and the defined symbols (variables) are valid only within the current file range.
2. # If, # Elif, # else, # endif is used to determine whether the identified code block needs to be compiled based on the defined symbols/variables. If not, it is not compiled, the generated executable file will be reduced accordingly.
# define debug using system; using system. collections. generic; using system. LINQ; using system. text; namespace client { class defineclass { Public static void Print () {# If DEBUG = false console. writeline ("print"); #endif }}