日期:2014-05-18  浏览次数:20734 次

如何去除文件的只读属性?
我的程序要实现更新文件功能,即用新的文件覆盖旧的文件,实现后文件属性就变成只读了,下次再操作时,就没法实现了.如何让文件属性不变为只读?

------解决方案--------------------
up
------解决方案--------------------
System.IO.File.SetAttributes(filename, System.IO.FileAttributes.Normal);
------解决方案--------------------
同意楼上的!
------解决方案--------------------
System.IO.File.SetAttributes(filename, System.IO.FileAttributes.Normal);

------解决方案--------------------
还可以获得文件后进行设置
用File对象进行设置
------解决方案--------------------
学习