一、

#define  #undef

 标记一个符号

取消标记一个符号

该指令要放在文件的开头

 

二、

#if #elif  #else #endif

(64)C# 预处理器指令_#define

 

符号还支持逻辑预算 ! == !=  ||

(64)C# 预处理器指令_#define_02

 

全局

 定义trace常量相当于#define TRACE

(64)C# 预处理器指令_#endif_03

 自定义全局

 

(64)C# 预处理器指令_#if_04

 

 打开文件实际设置

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;rr;tt</DefineConstants>
</PropertyGroup>

 

三、

#warning  #error

 

(64)C# 预处理器指令_#define_05

 

 

四、

#region  #endregion

 

五、

#line

 

六、

#pragma