#define
#undef
#if
#else
#elif(else if 的简写)
#endif
定义和不定义(#define、#undef)必须加在最开头
#define abc (要在所有非预处理指令的前面,包括命名空间)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
#if abc
Console.WriteLine("abc");
#endif
Console.ReadLine();
}
}
}
输出abc