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

代码如下:
string end = "";
#if DEBUG
{ end = "Debug";
Console.WriteLine(end);
}
#else
{
end = "no Debug";
Console.WriteLine(end);
}
#endif

浙公网安备 33010602011771号