IFileInfo 介面

定義

表示指定檔案提供者中的檔案。

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

屬性

Exists

如果資源存在於基礎儲存系統中,則為 true。

IsDirectory

當 case TryGetDirectoryContents 已列舉子目錄時,則為 true。

LastModified

取得檔案上次修改時間。

Length

檔案的長度 (以位元組為單位),或 -1 表示目錄或不存在的檔案。

Name

檔案或目錄的名稱,不包含任何路徑。

PhysicalPath

檔案的路徑,包含檔案名稱。 如果無法直接存取檔案,則會傳回 null。

方法

CreateReadStream()

以唯讀資料流形式傳回檔案內容。 完成時,呼叫者應該處置資料流。

適用於