• 如何删除只读文件?


    参考:

    http://msdn.microsoft.com/zh-cn/library/aa497275.aspx

    使用 System.IO.FileInfo 类来访问文件属性


    System.IO.FileInfo fi = new System.IO.FileInfo("filename");

    // remove readonly attribute
    if ((fi.Attributes & System.IO.FileAttributes.ReadOnly) != 0)
        fi.Attributes 
    -= System.IO.FileAttributes.ReadOnly;

    System.IO.File.Delete(
    "filename");


     
     
     
     

    --------------------------------------------------

    李森 – listen
    E-mail:  lisencool@gmail.com

    声明:
    这里集中了在WinCEWindows Mobile开发中的一些基本常识。我很乐意和大家分享,也希望大家提出意见,并给我投稿,我会第一时间替您发表并署上您的大名!

    Announce:
    Here collects general knowledge on WinCE and Windows mobile. I 'm very glad to share them with all friends, and also hope you can share your problems and opinions and contribute articles to me to share with others. I'll publish your articles and sign your name at the first time.

      



  • 相关阅读:
    类与对象
    类的声明与实例化
    面向对象的基本概念
    css下拉导航栏代码
    面向对象的三大特性
    面向对象三大基本特性,五大基本原则
    dom事件
    PHP 流程
    权限 查找
    留言板案例
  • 原文地址:https://www.cnblogs.com/Lisen/p/1572027.html
Copyright © 2020-2023  润新知