c#条件编译的设定

右击解决方案后

点击“配置管理器” 

下面两处都要添加工程

 另外在工程-》属性时要加上条件编译和符号加入相关的设定

 这样在工程中就可以使用#if #endif这样的宏来分割代码

#if big_screen
    int screen=2400;
#else
    int screen=1920;
#endif

猜你喜欢

转载自blog.csdn.net/babytiger/article/details/121099002