When #if DEBUG runs

后端 未结 7 610
星月不相逢
星月不相逢 2020-12-14 06:03

I have this code in my C# class.

#if DEBUG
        private const string BASE_URL = \"http://www.a.com/\";
#else
        private const string BASE_URL = \"h         


        
7条回答
  •  太阳男子
    2020-12-14 06:52

    If you are compiling with the DEBUG configuration, the code before the else line will get compiled while the other will not. If you compile in any other configuration, the second line will be compiled while the first will not.

提交回复
热议问题