FileInformation 類別

定義

提供從 StorageFile 公開之屬性的同步存取,並讓應用程式執行非同步檔案作業,例如複製、刪除、移動和重新命名。

public ref class FileInformation sealed : IStorageItemInformation, IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem2, IStorageItemPropertiesWithProvider
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class FileInformation final : IStorageItemInformation, IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem2, IStorageItemPropertiesWithProvider
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class FileInformation : IStorageItemInformation, IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem2, IStorageItemPropertiesWithProvider
Public NotInheritable Class FileInformation
Implements IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem2, IStorageItemInformation, IStorageItemPropertiesWithProvider
繼承
Object Platform::Object IInspectable FileInformation
屬性
實作

Windows 需求

裝置系列
Windows 10 (已於 10.0.10240.0 引進)
API contract
Windows.Foundation.UniversalApiContract (已於 v1.0 引進)

備註

您可以呼叫其中一個 fileInformationFactory.getFilesAsync 方法來擷取 FileInformation 物件清單。

屬性

Attributes

取得檔案的屬性。

BasicProperties

取得 物件,其中包含檔案的基本屬性資訊。

ContentType

取得描述檔案內容的字串。

DateCreated

取得檔案建立的日期。

DisplayName

取得 StorageFile的使用者易記名稱。

DisplayType

取得 StorageFile的顯示類型。

DocumentProperties

取得 物件,這個物件可讓您存取 StorageFile的檔案屬性,例如標題、作者名稱等等。

FileType

取得檔案類型。

FolderRelativeId

取得可唯一識別 StorageFile 相對於相同資料夾中其他專案的識別碼。

ImageProperties

取得 StorageFile的影像屬性,例如取得影像的標題、評等日期、

依此類推。

IsAvailable

指出目前檔案是否已下載或可下載。

MusicProperties

取得與 StorageFile相關聯的音樂屬性,例如相簿名稱、作者名稱、位元速率等等。

Name

取得 StorageFile的名稱。

Path

取得 StorageFile的路徑。

Properties

取得物件,用於擷取 StorageFile的屬性。

Provider

取得 StorageProvider 物件,其中包含儲存目前檔案之服務的相關資訊。

Thumbnail

取得與 StorageFile相關聯的縮圖。

VideoProperties

取得 物件,這個物件可讓您存取 StorageFile的視訊屬性,例如持續時間、評等、發行日期等等。

方法

CopyAndReplaceAsync(IStorageFile)

以目前檔案的複本取代指定的 StorageFile

CopyAsync(IStorageFolder)

建立 StorageFile 的複本,並將它儲存在指定的 StorageFolder中。

CopyAsync(IStorageFolder, String)

建立 StorageFile的複本、提供指定的檔案名,並將它儲存在指定的 StorageFolder中。

CopyAsync(IStorageFolder, String, NameCollisionOption)

建立 StorageFile的複本、提供指定的檔案名,並將它儲存在指定的 StorageFolder中。 如果具有相同名稱的檔案已存在於指定的資料夾中,方法也會指定該怎麼做。

DeleteAsync()

刪除檔案。

DeleteAsync(StorageDeleteOption)

刪除檔案,選擇性地將已刪除的檔案移至回收站。

GetBasicPropertiesAsync()

擷取 StorageFile的基本屬性。

GetParentAsync()

取得目前檔案的父資料夾。

GetThumbnailAsync(ThumbnailMode)

擷取與 StorageFile相關聯的縮圖。

GetThumbnailAsync(ThumbnailMode, UInt32)

擷取與 StorageFile相關聯的縮圖,並將其調整為指定的大小。

GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions)

根據指定的選項,擷取與 StorageFile相關聯的縮圖。

IsEqual(IStorageItem)

指出目前的檔案是否與指定的儲存專案相同。

IsOfType(StorageItemTypes)

判斷載入的 StorageFile 是否為指定的類型。

MoveAndReplaceAsync(IStorageFile)

將目前的 StorageFile 從其位置移動,並使用它取代指定的 StorageFile

MoveAsync(IStorageFolder)

StorageFile 移至指定的 StorageFolder

MoveAsync(IStorageFolder, String)

StorageFile 移至指定的資料夾,並提供指定的檔案名。

MoveAsync(IStorageFolder, String, NameCollisionOption)

StorageFile 移至指定的資料夾,並提供指定的檔案名。 如果具有相同名稱的檔案已存在於指定的資料夾中,方法也會指定該怎麼做。

OpenAsync(FileAccessMode)

開啟具有指定檔案上指定選項的隨機存取資料流程。

OpenAsync(FileAccessMode, StorageOpenOptions)

開啟具有指定檔案上指定選項的隨機存取資料流程。

OpenReadAsync()

開啟 StorageFile上的唯讀隨機存取資料流程。

OpenSequentialReadAsync()

開啟 StorageFile上的唯讀循序存取資料流程。

OpenTransactedWriteAsync()

開啟可用於交易寫入作業之檔案的隨機存取資料流程。

OpenTransactedWriteAsync(StorageOpenOptions)

開啟檔案的隨機存取資料流程,該檔案可用於具有指定選項的交易寫入作業。

RenameAsync(String)

重新命名 StorageFile

RenameAsync(String, NameCollisionOption)

重新命名 StorageFile,並指定如果具有相同名稱的檔案已存在於目前資料夾中,該怎麼辦。

事件

PropertiesUpdated

發生于更新一或多個 StorageFile的屬性時。

ThumbnailUpdated

StorageFile的縮圖更新或有更好的品質縮圖可供使用時引發。

適用於

另請參閱