私は長年にわたり店舗にいたWindows Phone 7アプリを持っています。 WP 7.x、8.0、および8.1デバイスにインストールされます。私はアプリをWP8.1をターゲットに変換しているので、新しいMicrosoft AdControl(古いものは年末に広告を配信しなくなる)を使うことができます。これは、古いIsolatedStorageFile.GetUserStoreForApplication()を使用する代わりに、ApplicationData.Current.LocalFolderを使用してデータを読み書きする必要があることを意味します。WP7からWP8.1アプリのアップデート。 WP8.1 ApplicationDataはWP7 IsolatedStorageFileを使用して保存された同じデータにアクセスしますか?
ユーザーには、IsolatedStorageFile.GetUserStoreForApplication()を使用して保存された多数のデータがあります。アプリケーションをWP8.1バージョンにアップグレードする場合、これらのデータが失われず、ApplicationData.Current.LocalFolderを使用してデータにアクセスできることを確認したいと思います。
これは誰でも確認できますか?
これは私がWP7にデータを書いた方法です:
using (IsolatedStorageFile applicationStorage = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream file = applicationStorage.OpenFile(filename, FileMode.Create, FileAccess.Write))
{
using (StreamWriter sw = new StreamWriter(file))
{
sw.WriteLine("some data goes here");
}
}
}
これは私がWP8.1でデータを読み込みする方法である。
using (Stream stream = await ApplicationData.Current.LocalFolder.OpenStreamForReadAsync(filename))
{
using (StreamReader sr = new StreamReader(stream))
{
String line = sr.ReadLine();
// Do something with line
}
}
分離ストレージを使用して
GeoITに感謝します。特に、PhoneProductIdの追加の部分については、 – Jared