C# 的 #if DEBUG使用

DEBUG+Assert调试代码还是不错。 int i = 10; #if DEBUG             Debug.Assert(i < 9,"条件不成立");             WriteLine("DEBUG"); #else       WriteLine("Release"); #endif 在Debug和Release模式下会分别执行不同的代码。 Debug Release
相关文章
相关标签/搜索