Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
StorageProvider Class
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.
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
- Attributes
Windows requirements
| Requirements | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| 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
| Name | Description |
|---|---|
| IsPropertySupportedForPartialFileAsync(String) |
Determines if a property is supported by a cloud storage provider. |
Applies to
See also
Feedback
Was this page helpful?
