ApplicationData class

3 out of 10 rated this helpful - Rate this topic

Provides access to the application data store. Application data consists of files and settings that are either local, roaming, or temporary.

Syntax


public ref class ApplicationData sealed : Object

Attributes

DualApiPartitionAttribute()
MarshalingBehaviorAttribute(Agile)
StaticAttribute(Windows.Storage.IApplicationDataStatics, NTDDI_WIN8)
ThreadingAttribute(MTA)
VersionAttribute(NTDDI_WIN8)

Members

The ApplicationData class has these types of members:

Events

The ApplicationData class has these events.

EventDescription
DataChanged Occurs when roaming application data is synchronized.

 

Methods

The ApplicationData class has these methods. With C#, Visual Basic, and C++, it also inherits methods from the Object class.

MethodDescription
ClearAsync() Removes all application data from the local, roaming, and temporary app data stores.
ClearAsync(ApplicationDataLocality) Removes all application data from the specified app data store.
SetVersionAsync Sets the version number of the application data in the app data store.
SignalDataChanged Sends a DataChanged | datachanged event to all registered event handlers.

 

Properties

The ApplicationData class has these properties.

PropertyAccess typeDescription

Current

Read-onlyProvides access to the app data store associated with the app's app package.

LocalFolder

Read-onlyGets the root folder in the local app data store.

LocalSettings

Read-onlyGets the application settings container in the local app data store.

RoamingFolder

Read-onlyGets the root folder in the roaming app data store.

RoamingSettings

Read-onlyGets the application settings container in the roaming app data store.

RoamingStorageQuota

Read-onlyGets the maximum size of the data that can be synchronized to the cloud from the roaming app data store.

TemporaryFolder

Read-onlyGets the root folder in the temporary app data store.

Version

Read-onlyGets the version number of the application data in the app data store.

 

Remarks

An app can also include files in its app package. To access files in the app package, use Windows.ApplicationModel.Package.Current.InstalledLocation.

Examples

The following code example demonstrates how to get the local settings container for the app.


using namespace Windows::Storage;

ApplicationDataContainer^ localSettings = ApplicationData::Current->LocalSettings;

Requirements

Minimum supported client

Windows 8 [Windows Store apps, desktop apps]

Minimum supported server

Windows Server 2012 [Windows Store apps, desktop apps]

Minimum supported phone

Windows Phone 8

Namespace

Windows.Storage
Windows::Storage [C++]

Metadata

Windows.winmd

DLL

Windows.Storage.ApplicationData.dll

See also

Tasks
Quickstart: Local application data (JavaScript)
Quickstart: Local application data (C#/VB/C++)
Quickstart: Roaming application data (JavaScript)
Quickstart: Roaming application data (C#/VB/C++)
Quickstart: Temporary application data (JavaScript)
Quickstart: Temporary application data (C#/VB/C++)
Concepts
Application data overview
Guidelines
Guidelines for roaming application data
Guidelines for app settings
Reference
ApplicationDataCompositeValue
ApplicationDataContainer
ApplicationDataContainerSettings
Samples
Application settings sample
Application data sample

 

 

Build date: 2/25/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.