//判斷是屬于測試還是應用
//#define X
using System;
using System.Diagnostics;
namespace 新特性
{
class Person
{
// [Conditional("X")]
public void Say(){
Console.WriteLine ("該方法為調(diào)試階段測試方法,發(fā)布以后該方法不會執(zhí)行");
}
public void SayNew(){
Console.WriteLine ("1111");
}
}
class MainClass
{
public static void Main (string[] args)
{
#if X
new Person ().Say ();
#else
new Person().SayNew();
#endif
}
}
}