IFileInfo 接口

定义

表示给定文件提供程序中的某个文件。Represents a file in the given file provider.

public interface class IFileInfo
public interface IFileInfo
type IFileInfo = interface
Public Interface IFileInfo
派生

属性

Exists

如果基础存储系统中存在资源,则为 True。True if resource exists in the underlying storage system.

IsDirectory

如果 TryGetDirectoryContents 枚举了子目录,则为 True。True for the case TryGetDirectoryContents has enumerated a sub-directory.

LastModified

获取上次修改文件的时间。Gets when the file was last modified.

Length

文件的长度(以字节为单位);对于目录或非现有文件,则返回 -1。The length of the file in bytes, or -1 for a directory or non-existing files.

Name

文件或目录的名称,不包括任何路径。The name of the file or directory, not including any path.

PhysicalPath

文件的路径,包括文件名。The path to the file, including the file name. 如果不可直接访问该文件,则返回 null。Return null if the file is not directly accessible.

方法

CreateReadStream()

返回只读流形式的文件内容。Return file contents as readonly stream. 调用方在完成后应释放流。Caller should dispose stream when complete.

适用于