DirectoryInfo directory;
public string Name {
get { return this.directory.Name; }
set { this.directory.Name = value; }
}
嗨。我有这个代码在C#中。它不起作用我得到这个错误:C#属性文件系统
Property or Indexer System.Io.FileSystemInfo.Name cannot be assigned to -- it's read only.
我该怎么办?
你想做什么? 'DirectoryInfo'完全按照它所说的做 - 让你获得目录上的信息。你想改变它指向的目录吗? –