zlzly

去掉只读属性 

 做一个导入数据的程序,首先将数据文件压缩成一个压缩包,上传的服务器后解压,导入成功后将上传文件删除,结果出现了,文件不可访问的错误,百度一下才知道是文件权限问题

用程序去除文件夹的只读属性:  System.IO.DirectoryInfo DirInfo = new DirectoryInfo(“filepath”);
                         DirInfo.Attributes = FileAttributes.Normal & FileAttributes.Directory;

去除文件的只读属性:      System.IO.File.SetAttributes("filepath", System.IO.FileAttributes.Normal);

分类:

技术点:

相关文章:

  • 2021-07-23
  • 2021-05-22
  • 2021-11-27
  • 2021-06-28
  • 2022-12-23
  • 2021-12-17
  • 2021-04-17
  • 2021-05-17
猜你喜欢
  • 2021-12-07
  • 2021-12-14
  • 2021-11-27
  • 2022-12-23
  • 2021-11-27
  • 2021-11-27
  • 2022-12-23
相关资源
相似解决方案