c#学习笔记之预处理

预处理是在编译之前进行处理的命令,因为之前没接触过,所以正好巩固一下 

c#中常见的预处理指令有 #if 、#else、#elif、#endif、#define、#undef、#warning、#errror、#line、#region、#endregion等等

eg:

 

图中显示了一个自己定义的警告。

其他语法:

#error “statement”;

#if expression

statement

#endif;

#if condition

statement

#elif condition

statement

#else

statement

#endif;

原文地址:https://www.cnblogs.com/zyqBlog/p/4360547.html