#region
#endregion

作用:折叠并隐藏代码

#if
#else
#endif

作用:控制编译的代码
例如: 
       #if(condition) 
              代码A 
       #else 
              代码B 
       #endif
如果condition为真,则程序编译的时候只编译代码A,如果condition为假,则程序编译的时候只编译代码B
所以, 
      #if 
      #else 
      #endif
只是一个起控制预编译的代码;如果不加#,当然就是一个简单的判断语句。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-06-15
  • 2022-12-23
  • 2021-05-15
  • 2021-05-29
  • 2022-12-23
猜你喜欢
  • 2021-07-30
  • 2021-07-11
  • 2021-05-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-16
相关资源
相似解决方案