FileSystemInfo 成员

FileInfoDirectoryInfo 对象提供基类。

下表列出了由 FileSystemInfo 类型公开的成员。

受保护的构造函数

  名称 说明
Protected method Supported by the .NET Compact Framework FileSystemInfo 已重载。初始化 FileSystemInfo 类的新实例。

页首

受保护的字段

  名称 说明
Protected field Supported by the .NET Compact Framework FullPath 表示目录或文件的完全限定目录。
Protected field Supported by the .NET Compact Framework OriginalPath 最初由用户指定的目录(不论是相对目录还是绝对目录)。

页首

公共属性

  名称 说明
Public property Supported by the .NET Compact Framework Attributes 获取或设置当前 FileSystemInfoFileAttributes
Public property Supported by the .NET Compact Framework CreationTime 获取或设置当前 FileSystemInfo 对象的创建时间。
Public property CreationTimeUtc 获取或设置当前 FileSystemInfo 对象的创建时间,其格式为协调通用时间 (UTC)。
Public property Supported by the .NET Compact Framework Exists 获取指示文件或目录是否存在的值。
Public property Supported by the .NET Compact Framework Extension 获取表示文件扩展名部分的字符串。
Public property Supported by the .NET Compact Framework FullName 获取目录或文件的完整目录。
Public property Supported by the .NET Compact Framework LastAccessTime 获取或设置上次访问当前文件或目录的时间。
Public property LastAccessTimeUtc 获取或设置上次访问当前文件或目录的时间,其格式为协调通用时间 (UTC)。
Public property Supported by the .NET Compact Framework LastWriteTime 获取或设置上次写入当前文件或目录的时间。
Public property LastWriteTimeUtc 获取或设置上次写入当前文件或目录的时间,其格式为协调通用时间 (UTC)。
Public property Supported by the .NET Compact Framework Name 对于文件,获取该文件的名称。对于目录,如果存在层次结构,则获取层次结构中最后一个目录的名称。否则,Name 属性获取该目录的名称。

页首

公共方法

(请参见 受保护的方法 )

  名称 说明
Public method CreateObjRef  创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。 (从 MarshalByRefObject 继承。)
Public method Supported by the .NET Compact Framework Delete 删除文件或目录。
Public method Supported by the .NET Compact Framework Equals  已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework GetHashCode  用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。)
Public method GetLifetimeService  检索控制此实例的生存期策略的当前生存期服务对象。 (从 MarshalByRefObject 继承。)
Public method GetObjectData 设置带有文件名和附加异常信息的 SerializationInfo 对象。
Public method Supported by the .NET Compact Framework GetType  获取当前实例的 Type。 (从 Object 继承。)
Public method InitializeLifetimeService  获取控制此实例的生存期策略的生存期服务对象。 (从 MarshalByRefObject 继承。)
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework Refresh 刷新对象的状态。
Public method Supported by the .NET Compact Framework ToString  返回表示当前 ObjectString。 (从 Object 继承。)

页首

受保护的方法

  名称 说明
Protected method Supported by the .NET Compact Framework Finalize  允许 Object 在“垃圾回收”回收 Object 之前尝试释放资源并执行其他清理操作。 (从 Object 继承。)
Protected method Supported by the .NET Compact Framework MemberwiseClone  已重载。 (从 MarshalByRefObject 继承。)

页首

请参见

参考

FileSystemInfo 类
System.IO 命名空间

其他资源

文件和流 I/O
如何:从文件读取文本
如何:向文件写入文本
基本的文件 I/O
如何:对新建的数据文件进行读取和写入