How do I delete a read-only file?

后端 未结 5 1894
囚心锁ツ
囚心锁ツ 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 05:54

    The equivalent if you happen to be working with a FileInfo object is:

    file.IsReadOnly = false;
    file.Delete();
    

提交回复
热议问题