C# set 跟 get 可以在类里面 private string name; public string Name { get { return name; } set { name = value; } }