C#中巧用#if DEBUG 进行调试#if DEBUG是个好东西。#if DEBUG UserID = "abc@test.com"; Password = "123456"; #endif 当调试代码的时候加上适当的判断,而不影响Release的代码。