调试时才执行的代码

只有在调试时才执行的DEBUG那部分的代码,否则执行else那部分的代码,最后用endif结束语句;

 

 

 

代码如下:

            string end = "";
#if DEBUG
         {   end = "Debug";
                Console.WriteLine(end);
          }

#else
            {
                end = "no Debug";
                Console.WriteLine(end);
            }

#endif

  

 

posted @ 2021-10-10 22:45  艾特-天空之海  阅读(44)  评论(0编辑  收藏  举报