StorageProvider Class

Definition

Contains info about the service that stores files and folders. Files and folders may be stored either by the local file system or by a remote service like Microsoft OneDrive.

C#
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class StorageProvider
Inheritance
Object StorageProvider
Attributes

Windows requirements

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

Examples

The following example demonstrates how to get the StorageProvider for a local file:

C#
using Windows.Storage;
using Windows.Storage.Provider;

// Get the file
StorageFile file = await StorageFile.GetFileFromPathAsync("C:\\example\\example.txt");

// Get the provider for the file
StorageProvider provider = file.Provider;

Remarks

For example, if a file or folder is stored on Microsoft OneDrive, StorageProvider will contain a display name, id, and thumbnail for Microsoft OneDrive.

Typically, you access StorageProvider objects as the result of calls to asynchronous methods and functions. They can also be accessed through properties of other file and folder objects such as the IStorageItemPropertiesWithProvider.Provider, StorageFile.Provider, and StorageFolder.Provider properties.

Version history

Windows version SDK version Value added
1709 16299 IsPropertySupportedForPartialFileAsync

Properties

DisplayName

Gets a user-friendly name for the current provider of files and folders.

Id

Gets an identifier for the current provider of files and folders.

Methods

IsPropertySupportedForPartialFileAsync(String)

Determines if a property is supported by a cloud storage provider.

Applies to

Product Versions
WinRT Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100

See also