FileInformation FileInformation FileInformation FileInformation FileInformation Class

Definition

Provides synchronous access to the properties exposed off StorageFile and lets an app perform asynchronous file operations such as copy, delete, move, and rename.

public : sealed class FileInformation : IStorageItemInformation, IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem, IStorageItem2, IStorageItemProperties, IStorageItemPropertiesWithProvider, IInputStreamReference, IRandomAccessStreamReference
struct winrt::Windows::Storage::BulkAccess::FileInformation : IStorageItemInformation, IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem, IStorageItem2, IStorageItemProperties, IStorageItemPropertiesWithProvider, IInputStreamReference, IRandomAccessStreamReference
public sealed class FileInformation : IStorageItemInformation, IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem, IStorageItem2, IStorageItemProperties, IStorageItemPropertiesWithProvider, IInputStreamReference, IRandomAccessStreamReference
Public NotInheritable Class FileInformation Implements IStorageItemInformation, IStorageFile, IStorageFile2, IStorageFilePropertiesWithAvailability, IStorageItem, IStorageItem2, IStorageItemProperties, IStorageItemPropertiesWithProvider, IInputStreamReference, IRandomAccessStreamReference
// This class does not provide a public constructor.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

You can retrieve a list of FileInformation objects by calling one of the fileInformationFactory.getFilesAsync methods.

Properties

Attributes Attributes Attributes Attributes Attributes

Gets the attributes of a file.

BasicProperties BasicProperties BasicProperties BasicProperties BasicProperties

Gets an object that contains the basic properties information of the file.

ContentType ContentType ContentType ContentType ContentType

Gets a string that describes the contents of the file.

DateCreated DateCreated DateCreated DateCreated DateCreated

Gets the date that the file was created.

DisplayName DisplayName DisplayName DisplayName DisplayName

Gets the user-friendly name of the StorageFile.

DisplayType DisplayType DisplayType DisplayType DisplayType

Gets the display type of the StorageFile.

DocumentProperties DocumentProperties DocumentProperties DocumentProperties DocumentProperties

Gets an object that provides access to the document properties of the StorageFile, such as the title, author name, and so on.

FileType FileType FileType FileType FileType

Gets the file type.

FolderRelativeId FolderRelativeId FolderRelativeId FolderRelativeId FolderRelativeId

Gets the identifier that uniquely identifies the StorageFile relative to other items in the same folder.

ImageProperties ImageProperties ImageProperties ImageProperties ImageProperties

Gets the image properties of the StorageFile, such as the title, rating, date that the image was taken,

and so on.

IsAvailable IsAvailable IsAvailable IsAvailable IsAvailable

Indicates if the current file has been downloaded or can be downloaded.

MusicProperties MusicProperties MusicProperties MusicProperties MusicProperties

Gets the music properties associated with the StorageFile, such as the album name, artist name, bit rate, and so on.

Name Name Name Name Name

Gets the name of the StorageFile.

Path Path Path Path Path

Gets the path of the StorageFile.

Properties Properties Properties Properties Properties

Gets an object for retrieving the properties of the StorageFile.

Provider Provider Provider Provider Provider

Gets the StorageProvider object that contains info about the service that stores the current file.

Thumbnail Thumbnail Thumbnail Thumbnail Thumbnail

Gets the thumbnail associated with the StorageFile.

VideoProperties VideoProperties VideoProperties VideoProperties VideoProperties

Gets an object that provides access to the video properties of the StorageFile, such as the duration, rating, date released, and so on.

Methods

CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile) CopyAndReplaceAsync(IStorageFile)

Replaces the specified StorageFile with a copy of the current file.

CopyAsync(IStorageFolder) CopyAsync(IStorageFolder) CopyAsync(IStorageFolder) CopyAsync(IStorageFolder) CopyAsync(IStorageFolder)

Creates a copy of the StorageFile and stores it in the specified StorageFolder.

CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String) CopyAsync(IStorageFolder, String)

Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder.

CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption) CopyAsync(IStorageFolder, String, NameCollisionOption)

Creates a copy of the StorageFile, gives it the specified file name, and stores it in the specified StorageFolder. The method also specifies what to do if a file with the same name already exists in the specified folder.

DeleteAsync() DeleteAsync() DeleteAsync() DeleteAsync() DeleteAsync()

Deletes a file.

DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption) DeleteAsync(StorageDeleteOption)

Deletes a file, optionally moving the deleted file to the recycle bin.

GetBasicPropertiesAsync() GetBasicPropertiesAsync() GetBasicPropertiesAsync() GetBasicPropertiesAsync() GetBasicPropertiesAsync()

Retrieves the basic properties of the StorageFile.

GetParentAsync() GetParentAsync() GetParentAsync() GetParentAsync() GetParentAsync()

Gets the parent folder of the current file.

GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode) GetThumbnailAsync(ThumbnailMode)

Retrieves the thumbnail that is associated with the StorageFile.

GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32) GetThumbnailAsync(ThumbnailMode, UInt32)

Retrieves the thumbnail that is associated with the StorageFile, scaling it to the specified size.

GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions) GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions)

Retrieves the thumbnail that is associated with the StorageFile, based on the specified options.

IsEqual(IStorageItem) IsEqual(IStorageItem) IsEqual(IStorageItem) IsEqual(IStorageItem) IsEqual(IStorageItem)

Indicates whether the current file is the same as the specified storage item.

IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes) IsOfType(StorageItemTypes)

Determines whether the loaded StorageFile is the specified type.

MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile) MoveAndReplaceAsync(IStorageFile)

Moves the current StorageFile from its location and uses it to replace the specified StorageFile.

MoveAsync(IStorageFolder) MoveAsync(IStorageFolder) MoveAsync(IStorageFolder) MoveAsync(IStorageFolder) MoveAsync(IStorageFolder)

Moves the StorageFile to the specified StorageFolder.

MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String) MoveAsync(IStorageFolder, String)

Moves the StorageFile to the specified folder, and gives the file the specified file name.

MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption) MoveAsync(IStorageFolder, String, NameCollisionOption)

Moves the StorageFile to the specified folder and gives it the specified file name. The method also specifies what to do if a file with the same name already exists in the specified folder.

OpenAsync(FileAccessMode) OpenAsync(FileAccessMode) OpenAsync(FileAccessMode) OpenAsync(FileAccessMode) OpenAsync(FileAccessMode)

Opens a random-access stream with the specified options over the specified file.

OpenAsync(FileAccessMode, StorageOpenOptions) OpenAsync(FileAccessMode, StorageOpenOptions) OpenAsync(FileAccessMode, StorageOpenOptions) OpenAsync(FileAccessMode, StorageOpenOptions) OpenAsync(FileAccessMode, StorageOpenOptions)

Opens a random-access stream with the specified options over the specified file.

OpenReadAsync() OpenReadAsync() OpenReadAsync() OpenReadAsync() OpenReadAsync()

Opens a read-only, random-access stream over the StorageFile.

OpenSequentialReadAsync() OpenSequentialReadAsync() OpenSequentialReadAsync() OpenSequentialReadAsync() OpenSequentialReadAsync()

Opens a read-only, sequential-access stream over the StorageFile.

OpenTransactedWriteAsync() OpenTransactedWriteAsync() OpenTransactedWriteAsync() OpenTransactedWriteAsync() OpenTransactedWriteAsync()

Opens a random-access stream to the file that can be used for transacted-write operations.

OpenTransactedWriteAsync(StorageOpenOptions) OpenTransactedWriteAsync(StorageOpenOptions) OpenTransactedWriteAsync(StorageOpenOptions) OpenTransactedWriteAsync(StorageOpenOptions) OpenTransactedWriteAsync(StorageOpenOptions)

Opens a random-access stream to the file that can be used for transacted-write operations with the specified options.

RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String) RenameAsync(String)

Renames the StorageFile.

RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption) RenameAsync(String, NameCollisionOption)

Renames the StorageFile, and specifies what to do if a file with the same name already exists in the current folder.

Events

PropertiesUpdated PropertiesUpdated PropertiesUpdated PropertiesUpdated PropertiesUpdated

Occurs when one or more of the StorageFile 's properties is updated.

ThumbnailUpdated ThumbnailUpdated ThumbnailUpdated ThumbnailUpdated ThumbnailUpdated

Fires when the StorageFile 's thumbnail is updated or a better quality thumbnail is available.

See Also