我正在使用Visual Studio 2017并尝试为Windows Phone编程C#UWP应用程序。当我尝试在主机和模拟器(Mobile emulator 10.0.15063.0)之间测试漫游应用程序数据时,数据不会同步。即使等了几个小时。模拟器看起来像我的电子邮件和跨设备的日历同步一样工作。当我搜索主机上的文件,这似乎是正确创建:在仿真器C中测试漫游应用程序数据#
C:\Users\Owner\AppData\Local\Packages\23840StartPoint.StartPointRunning_x6wjmepvaasdr\RoamingState
我检查了包清单和包名和版本匹配。我尝试了几种不同的选择,但没有任何作用。我错过了什么。
来自GitHub的应用程序数据示例是我用来教导自己写/读文件的模型。它也不适用于我的设置。
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();
你如何共享数据,PC和UWP之间? – ArchAngel
我正在通过漫游文件夹共享一个小文本文件(约150字节)。我是新的和不确定如何添加代码到我的评论。你能提出一种方法吗?我试图添加back-ticks,但没有奏效。 – VaBRC
您可以编辑您的原始问题以添加相关的代码段和其他更新。 –