DirectoryInfo 成员

公开用于创建、移动和枚举目录和子目录的实例方法。无法继承此类。

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

公共构造函数

  名称 说明
Public method Supported by the .NET Compact Framework DirectoryInfo 在指定的路径中初始化 DirectoryInfo 类的新实例。

页首

公共属性

  名称 说明
Public property Supported by the .NET Compact Framework Attributes  获取或设置当前 FileSystemInfoFileAttributes。(从 FileSystemInfo 继承。)
Public property Supported by the .NET Compact Framework CreationTime  获取或设置当前 FileSystemInfo 对象的创建时间。(从 FileSystemInfo 继承。)
Public property CreationTimeUtc  获取或设置当前 FileSystemInfo 对象的创建时间,其格式为协调通用时间 (UTC)。(从 FileSystemInfo 继承。)
Public property Supported by the .NET Compact Framework Exists 已重写。获取指示目录是否存在的值。
Public property Supported by the .NET Compact Framework Extension  获取表示文件扩展名部分的字符串。(从 FileSystemInfo 继承。)
Public property Supported by the .NET Compact Framework FullName  获取目录或文件的完整目录。(从 FileSystemInfo 继承。)
Public property Supported by the .NET Compact Framework LastAccessTime  获取或设置上次访问当前文件或目录的时间。(从 FileSystemInfo 继承。)
Public property LastAccessTimeUtc  获取或设置上次访问当前文件或目录的时间,其格式为协调通用时间 (UTC)。(从 FileSystemInfo 继承。)
Public property Supported by the .NET Compact Framework LastWriteTime  获取或设置上次写入当前文件或目录的时间。(从 FileSystemInfo 继承。)
Public property LastWriteTimeUtc  获取或设置上次写入当前文件或目录的时间,其格式为协调通用时间 (UTC)。(从 FileSystemInfo 继承。)
Public property Supported by the .NET Compact Framework Name 已重写。获取此 DirectoryInfo 实例的名称。
Public property Supported by the .NET Compact Framework Parent 获取指定子目录的父目录。
Public property Supported by the .NET Compact Framework Root 获取路径的根部分。

页首

公共方法

  名称 说明
Public method Create 已重载。 创建目录。
Public method CreateObjRef  创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。 (从 MarshalByRefObject 继承。)
Public method Supported by the .NET Compact Framework CreateSubdirectory 已重载。 在指定路径中创建一个或多个子目录。指定路径可以是相对于 DirectoryInfo 类的此实例的路径。
Public method Supported by the .NET Compact Framework Delete 已重载。 已重写。 从路径中删除 DirectoryInfo 及其内容。
Public method Supported by the .NET Compact Framework Equals  已重载。 确定两个 Object 实例是否相等。 (从 Object 继承。)
Public method GetAccessControl 已重载。 获取当前目录的访问控制列表 (ACL) 项。
Public method Supported by the .NET Compact Framework GetDirectories 已重载。 返回当前目录的子目录。
Public method Supported by the .NET Compact Framework GetFiles 已重载。 返回当前目录的文件列表。
Public method Supported by the .NET Compact Framework GetFileSystemInfos 已重载。 检索表示当前目录的文件和子目录的强类型 FileSystemInfo 对象的数组。
Public method Supported by the .NET Compact Framework GetHashCode  用作特定类型的哈希函数。GetHashCode 适合在哈希算法和数据结构(如哈希表)中使用。 (从 Object 继承。)
Public method GetLifetimeService  检索控制此实例的生存期策略的当前生存期服务对象。 (从 MarshalByRefObject 继承。)
Public method GetObjectData  设置带有文件名和附加异常信息的 SerializationInfo 对象。 (从 FileSystemInfo 继承。)
Public method Supported by the .NET Compact Framework GetType  获取当前实例的 Type。 (从 Object 继承。)
Public method InitializeLifetimeService  获取控制此实例的生存期策略的生存期服务对象。 (从 MarshalByRefObject 继承。)
Public method Supported by the .NET Compact Framework MoveTo DirectoryInfo 实例及其内容移动到新路径。
Public method Static Supported by the .NET Compact Framework ReferenceEquals  确定指定的 Object 实例是否是相同的实例。 (从 Object 继承。)
Public method Supported by the .NET Compact Framework Refresh  刷新对象的状态。 (从 FileSystemInfo 继承。)
Public method SetAccessControl DirectorySecurity 对象所描述的访问控制列表 (ACL) 项应用于当前 DirectoryInfo 对象所描述的目录。
Public method Supported by the .NET Compact Framework ToString 已重写。 返回用户所传递的原始路径。

页首

请参见

参考

DirectoryInfo 类
System.IO 命名空间
File
Attributes
Directory 类
Path

其他资源

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