(64)C# 预处理器指令

 一、

#define  #undef

 标记一个符号

取消标记一个符号

该指令要放在文件的开头

 

二、

#if #elif  #else #endif

 

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

 

全局

 定义trace常量相当于#define TRACE

 自定义全局

 

 

 打开文件实际设置

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

 

三、

#warning  #error

 

 

 

四、

#region  #endregion

 

五、

#line

 

六、

#pragma

 

posted @ 2019-11-09 11:02  富坚老贼  阅读(288)  评论(0)    收藏  举报