c# - Get Local Folders from App WinRT -


i'm having issue trying save file folder of winrt app i'm working at. more specific : can't manage retrieve folder. need save files , afterwards retrieve them same folder, let's myfolder @ same level in app assets folder. how can achieve such thing?

so far tried

await windows.applicationmodel.package.current.installedlocation.getfolderasync("myfolder") 

and

await applicationdata.current.localfolder.getfolderasync("myfolder"); 

and both seem tell me such folder doesn't exist. now, can't seem figure out if i'm on right track or it's foolish i've done , causes exception. can't post whole code, because it's call larger method other calls, , on.

also, i'd know (if of these methods correct), if app gets update, content affected in way (better said, lost).

thank you.

windows.applicationmodel.package.current.installedlocation give 'file system' defined application package, you'd see commonly used asset folder, instance, via uri ms-appx:///assets accessed via installedlocation or ms-appx scheme read-only because it's defined project deployed visual studio.

applicationdata.current.localfolder allows access 'file system' owned current application/user (and stored @ %appdata%/local/packages/<yourapppackage>/localstate). can create whatever structure want here manage various roles, , use ms-appdata:///local/dirleve1/dirleve2/file3 uri access files). storage retained through updates application, though, of course, you'll need strategy updating whatever stored data formats required interact newer version of application.

it sounds you're assuming localfolder cannot contain folder hiearachy; can, , have recents subfolder instance under localfolder reference , handle things way.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -