zoukankan      html  css  js  c++  java
  • 列举指定目录下的文件

                                    DirectoryInfo di = new DirectoryInfo(path2);
                                    FileInfo[] file = di.GetFiles("*.jpg");
                                    try
                                    {
                                        foreach (FileInfo fi in file)
                                        {
    fi.FullName
    

      Attributes  获取或设置当前 FileSystemInfo 的 FileAttributes。 (继承自 FileSystemInfo。)
      CreationTime  获取或设置当前 FileSystemInfo 对象的创建时间。 (继承自 FileSystemInfo。)
    CreationTimeUtc  获取或设置当前 FileSystemInfo 对象的创建时间,其格式为协调通用时间 (UTC)。 (继承自 FileSystemInfo。)
      Directory  获取父目录的实例。
      DirectoryName  获取表示目录的完整路径的字符串。
      Exists  获取指示文件是否存在的值。 (重写 FileSystemInfo..::.Exists。)
      Extension  获取表示文件扩展名部分的字符串。 (继承自 FileSystemInfo。)
      FullName  获取目录或文件的完整目录。 (继承自 FileSystemInfo。)
    IsReadOnly  获取或设置确定当前文件是否为只读的值。
      LastAccessTime  获取或设置上次访问当前文件或目录的时间。 (继承自 FileSystemInfo。)
    LastAccessTimeUtc  获取或设置上次访问当前文件或目录的时间,其格式为协调通用时间 (UTC)。 (继承自 FileSystemInfo。)
      LastWriteTime  获取或设置上次写入当前文件或目录的时间。 (继承自 FileSystemInfo。)
    LastWriteTimeUtc  获取或设置上次写入当前文件或目录的时间,其格式为协调通用时间 (UTC)。 (继承自 FileSystemInfo。)
      Length  获取当前文件的大小(字节)。
      Name  获取文件名。 (重写 FileSystemInfo..::.Name。)

  • 相关阅读:
    json2源码
    在table中插入别的代码
    基于HTML5和Javascript的移动应用架构
    webkitscrollbar
    性能调优之Javascript内存泄漏
    javascript时区函数介绍
    几道面试题
    CSS property: webkitbackfacevisibility
    某人2013js趋势的一些判断
    用js操作cookie保存浏览记录
  • 原文地址:https://www.cnblogs.com/wjhx/p/1806557.html
Copyright © 2011-2022 走看看