Visual Studio 2017を使用していて、Windows Phone用のC#UWPアプリケーションをプログラミングしようとしています。ホストコンピュータとエミュレータ(Mobileエミュレータ10.0.15063.0)間でアプリケーションデータの移動をテストしようとすると、データが同期しません。数時間待ってから。エミュレータは、デバイス間で電子メールとカレンダーの同期として機能しているようです。私は、ホストコンピュータ上のファイルを検索するとき、正しく作成されるように表示されます。エミュレータCのローミングアプリケーションデータのテスト#
C:\Users\Owner\AppData\Local\Packages\23840StartPoint.StartPointRunning_x6wjmepvaasdr\RoamingState
私はマニフェストとパッケージ名とバージョンが一致パッケージをチェックしています。私はいくつかのオプションを試しましたが、何も動作しません。私は何かが欠けている。
GitHubのApplication Dataサンプルは、ファイルの書き込み/読み取りに自分で教えるモデルとして使用したものです。私のセットアップでも動作しません。
var applicationData = ApplicationData.Current;
ulong storage = applicationData.RoamingStorageQuota;
//Create file client.txt => store data => Roaming folder
ApplicationDataContainer roamingSettings = ApplicationData.Current.RoamingSettings;
StorageFolder roamingFolder1 = ApplicationData.Current.RoamingFolder;
StorageFile file1 = await roamingFolder1.CreateFileAsync(Filename1, CreationCollisionOption.ReplaceExisting);
SetUpFlag = "true";
String string6 = Views.Colors101.m_BackGroundColor + ";" + Views.Colors101.m_CalendarColor + ";" + Views.Colors101.m_HeaderColor;
String toWrite = SetUpFlag + ";" + string6;
StorageFile xfile1 = await roamingFolder1.GetFileAsync(Filename1);
await FileIO.WriteTextAsync(xfile1, toWrite);
ApplicationData.Current.SignalDataChanged();
...それは良い作品かどうかを確認するために私のバージョンを試してみてください? – ArchAngel
ローミングフォルダを使用して小さなテキストファイル(約150バイト)を共有しています。私はコメントにコードを追加する方法が不明で、新しいです。あなたは方法を提案できますか?私はバックティックを追加しようとしましたが、うまくいきませんでした。 – VaBRC
元の質問を編集して、相対コードスニペットやその他の更新を追加することができます。 –