在Compact Framework中删除readonly
在Compact Framework中删除文件的readonly属性的首选方法是什么,因为我们没有File :: SetAttributes?
您可以使用OpenNetCF 智能设备框架 ,该框架具有实现SetAttributesfunction的FileHelper类。
或者,如果您不想使用该路由,则可以PInvoke本机SetFileAttributes方法。
这也有效:
上述就是C#学习教程:在Compact Framework中删除readonly分享的全部内容,如果对大家有所用处且需要了解更多关于C#学习教程,希望大家多多关注—计算机技术网(www.ctvol.com)!
FileInfo fileInfo = new FileInfo(path); FileAttributes attributes = fileInfo.Attributes; if ((attributes & FileAttributes.ReadOnly) == FileAttributes.ReadOnly) { // set the attributes to nonreadonly fileInfo.Attributes &= ~FileAttributes.ReadOnly; }
本文来自网络收集,不代表计算机技术网立场,如涉及侵权请联系管理员删除。
ctvol管理联系方式QQ:251552304
本文章地址:https://www.ctvol.com/cdevelopment/951211.html