C# 删除文件被拒绝

 

 

                if(File.Exists(copyPath + "\\" + name)==true)
                {
                    //删除提示访问被拒绝,增加此行代码
                    new FileInfo(filePath).Attributes = FileAttributes.Normal;
                    File.Delete(copyPath + "\\" + name);
                }
                

 

posted @ 2023-10-11 19:47  博客YS  阅读(320)  评论(1编辑  收藏  举报