Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

StorageFile.GetBasicPropertiesAsync Method

Definition

Namespace:
Windows.Storage

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Gets the basic properties of the current file.

public:
 virtual IAsyncOperation<BasicProperties ^> ^ GetBasicPropertiesAsync() = GetBasicPropertiesAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<BasicProperties> GetBasicPropertiesAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<BasicProperties> GetBasicPropertiesAsync();
function getBasicPropertiesAsync()
Public Function GetBasicPropertiesAsync () As IAsyncOperation(Of BasicProperties)

Returns

When this method completes successfully, it returns the basic properties of the current file as a BasicProperties object.

Implements

Attributes

Examples

This example shows you how to access basic properties of a file using the GetBasicPropertiesAsync method of a StorageFile object:

BasicProperties basicProperties = await storageFile.GetBasicPropertiesAsync();
ulong size = basicProperties.Size;

You must have a StorageFile object (storageFile in the example) that represents your file in order to invoke the storageFile.GetBasicPropertiesAsync method.

Remarks

This method will return E_ILLEGAL_METHOD_CALL if there are other async operations in progress on the same IStorageItem instance. Make sure that another thread isn't modifying the IStorageItem at the same time.

Applies to

See also


Feedback

Was this page helpful?