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。)

  • 相关阅读:
    bash的shebang行
    Step By Step(Lua调用C函数)
    [Android问答] px、dp和sp,这些单位有什么区别?
    Android中Application类用法
    Android中SharedPreferences用法
    Android中SQLite用法
    SQLite应用实例
    Android中Parcelable接口用法
    iOS block 基本用法及代替代理
    Xcode插件
  • 原文地址:https://www.cnblogs.com/wjhx/p/1806557.html
Copyright © 2011-2022 走看看