c# - UWP roamingdata Does not async -


i make uwp app share data between windows 10 pc , windows 10 mobile phone.next code:

    public static storagefolder roamingfolder = applicationdata.current.roamingfolder;     public async static task writetoroamingdataasync(string str)     {         storagefile savedfile = await roamingfolder.createfileasync("datafile", creationcollisionoption.replaceexisting);         await fileio.writetextasync(savedfile, str);     }      public async static task<string> readroamingdataasync()     {         try         {             storagefile savedfile = await roamingfolder.getfileasync("datafile");             return await fileio.readtextasync(savedfile);         }         catch         {             return "-1";         }     } 

i changed data in pc(input string "here data"), , can read in pc.but when deployed on phone, can't read data had written on pc,it give me "-1",i waited 2 hours,the mobile app gives me "-1".

i think maybe should upload app windows store can wright effect.but need test function before upload.

here somethings should declare because found answers can't solve problem:

  1. i closed app on pc before open app on mobilephone.
  2. i used same hotmail account in pc , mobilephome.

at last ,thank help!


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -