Κοινή χρήση μέσω


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.

public ref class StorageProvider sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
class StorageProvider final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Standard)]
public sealed class StorageProvider
Public NotInheritable Class StorageProvider
Inheritance
Object Platform::Object IInspectable 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:

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

See also