c#读写文件没有权限处理方法:
using System.Security.AccessControl;
string filePath = ""; //文件路径,绝对路径
DirectorySecurity ds = new DirectorySecurity();
ds.AddAccessRule(new FileSystemAccessRule("Everyone", FileSystemRights.fullControl, InheritanceFlags.ContainerInherit | InheritanceFlags.ObjectInherit, PropagationFlags.None, AccessControlType.Allow));
System.IO.Directory.SetAccessControl(filePath, ds);