Remove readonly attribute from directory

前端 未结 8 1137
情歌与酒
情歌与酒 2020-12-01 06:23

How can I programatically remove the readonly attribute from a directory in C#?

8条回答
  •  时光说笑
    2020-12-01 06:41

    var di = new DirectoryInfo("SomeFolder");
    di.Attributes &= ~FileAttributes.ReadOnly;
    

提交回复
热议问题