列举指定目录下的文件

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

原文地址:https://www.cnblogs.com/wjhx/p/1806557.html