准备
第一步,新建一个“控制台”,代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Atttibute
{
class Program
{
static void Main(string[] args)
{
Student student = new Student();
}
}
}
第二步,准备一个“Student”类,代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Atttibute
{
/// <summary>
/// 这里是注释,除了让人看懂这里写的是什么,
/// 对运行没有任何影响
/// </summary>
[Obsolete("请不要使用这个了,请使用什么来代替", true)]
[Serializable]