[Serializable]//Attribute 特性
class Introduction
{
private String _name;//Field 字段
public String Name //Property 属性
{
get { return _name; }
set { _name = value; }
}
[Obsolete("此方法已经废弃,请调用新的替代方法DisplayNew(). 2011.7.31")]//Attribute 特性
public void Display()
{
Console.WriteLine(this._name);//某个已经过时的方法
}
public void DisplayNew()
{
Console.WriteLine("UserName = {0}", this._name);//新方法
}
}