也许在最新版本的C#中我错过了一些东西,但对我来说这个代码应该不起作用了.
public class FileManip { public FileManip(string path) { appPath = path; } private string appPath { get; } //............... }
c# properties set readonly
c# ×1
properties ×1
readonly ×1
set ×1