How do I delete a read-only file?

后端 未结 5 1892
囚心锁ツ
囚心锁ツ 2020-12-14 05:14

I\'ve got a junk directory where I toss downloads, one-off projects, email drafts, and other various things that might be useful for a few days but don\'t need to be saved f

5条回答
  •  悲哀的现实
    2020-12-14 06:11

    According to File.Delete's documentation,, you'll have to strip the read-only attribute. You can set the file's attributes using File.SetAttributes().

提交回复
热议问题