ApplicationData.LocalPath Property

Definition

A string value that represents the path for the local data store. This location is backed up to the cloud.

public:
 property Platform::String ^ LocalPath { Platform::String ^ get(); };
winrt::hstring LocalPath();
public string LocalPath { get; }
var string = applicationData.localPath;
Public ReadOnly Property LocalPath As String

Property Value

String

Platform::String

winrt::hstring

Returns the path for the local data store.

Examples

The following example shows how to save data to the local data store:

void SaveData(string data)
{
    var applicationData = ApplicationData.GetDefault();
    var filename = Path.Combine(applicationData.LocalPath, "applicationdata.dat");
    File.WriteAllText(filename, data, System.Text.UTF8Encoding);
}

Remarks

This is equivalent to Windows.Storage.ApplicationData.LocalFolder().Path.

Applies to