ApplicationData.GetForPackageFamily(String) Method
Definition
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.
Get an instance of ApplicationData for the specified package family for the current user.
public:
static ApplicationData ^ GetForPackageFamily(Platform::String ^ packageFamilyName);
static ApplicationData GetForPackageFamily(winrt::hstring const& packageFamilyName);
public static ApplicationData GetForPackageFamily(string packageFamilyName);
function getForPackageFamily(packageFamilyName)
Public Shared Function GetForPackageFamily (packageFamilyName As String) As ApplicationData
Parameters
- packageFamilyName
-
String
Platform::String
winrt::hstring
Returns
Examples
The following example shows how to save data to the application data store for a specific package family:
void SaveData(string data)
{
string packageFamilyName = "Fabrikam.Contoso_1234567890abc";
var applicationData = ApplicationData.GetForPackageFamily(packageFamilyName);
var filename = Path.Combine(applicationData.LocalPath, "applicationdata.dat");
File.WriteAllText(filename, data, System.Text.UTF8Encoding);
}
Remarks
Note that this method is equivalent to Windows.Storage.ApplicationDataManager.CreateForPackageFamily().