Udostępnij za pośrednictwem


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 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
Inheritance
Object Platform::Object IInspectable FileInformation
Attributes
Implements

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Remarks

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

Properties

Attributes

Gets the attributes of a file.

BasicProperties

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

ContentType

Gets a string that describes the contents of the file.

DateCreated

Gets the date that the file was created.

DisplayName

Gets the user-friendly name of the StorageFile.

DisplayType

Gets the display type of the StorageFile.

DocumentProperties

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

FileType

Gets the file type.

FolderRelativeId

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

ImageProperties

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

and so on.

IsAvailable

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

MusicProperties

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

Name

Gets the name of the StorageFile.

Path

Gets the path of the StorageFile.

Properties

Gets an object for retrieving the properties of the StorageFile.

Provider

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

Thumbnail

Gets the thumbnail associated with the StorageFile.

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)

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

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.

CopyAsync(IStorageFolder, String)

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

CopyAsync(IStorageFolder)

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

DeleteAsync()

Deletes a file.

DeleteAsync(StorageDeleteOption)

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

GetBasicPropertiesAsync()

Retrieves the basic properties of the StorageFile.

GetParentAsync()

Gets the parent folder of the current file.

GetThumbnailAsync(ThumbnailMode, UInt32, ThumbnailOptions)

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

GetThumbnailAsync(ThumbnailMode, UInt32)

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

GetThumbnailAsync(ThumbnailMode)

Retrieves the thumbnail that is associated with the StorageFile.

IsEqual(IStorageItem)

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

IsOfType(StorageItemTypes)

Determines whether the loaded StorageFile is the specified type.

MoveAndReplaceAsync(IStorageFile)

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

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.

MoveAsync(IStorageFolder, String)

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

MoveAsync(IStorageFolder)

Moves the StorageFile to the specified StorageFolder.

OpenAsync(FileAccessMode, StorageOpenOptions)

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

OpenAsync(FileAccessMode)

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

OpenReadAsync()

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

OpenSequentialReadAsync()

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

OpenTransactedWriteAsync()

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

OpenTransactedWriteAsync(StorageOpenOptions)

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

RenameAsync(String, NameCollisionOption)

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

RenameAsync(String)

Renames the StorageFile.

Events

PropertiesUpdated

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

ThumbnailUpdated

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

Applies to

See also