ASP.NET File.Delete只读文件引起的访问被拒绝,设置文件属性为Normal

      new FileInfo(f).Attributes = FileAttributes.Normal;
      File.Delete(f);

设置文件属性为Normal,然后再执行删除操作。

原文地址:https://www.cnblogs.com/dupeng0811/p/2518506.html