C# 判断文件是否只读,并去除只读属性

 //若文件为只读状态,将其更改为非只读状态
                    if (System.IO.File.GetAttributes(pOldFilePath).ToString().IndexOf("ReadOnly") != -1)
                    {
                        File.SetAttributes(pOldFilePath, FileAttributes.Normal);
                    }

猜你喜欢

转载自blog.csdn.net/bruce135lee/article/details/80118233