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 |
當 case 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. |