Reputation: 55
What is the right place for my Windows 10 IoT UWP app to persist temporary working data considering the device is occasionally turned off ? I have been researching about saving files on the SD card and reading from it, but it's been tough. Not even the code below is running, for the line IReadOnlyList<StorageFile> files = await folder.GetFilesAsync();
is causing the task to abort without raising any error. It's VS 2015 on Raspberry Pi 2.
public async void pop()
{
StorageFolder folder = Windows.Storage.ApplicationData.Current.LocalFolder;
IReadOnlyList<StorageFile> files = await folder.GetFilesAsync();
foreach (StorageFile sf in files)
{
if (sf.Name.EndsWith(".mtk"))
{
var file = await folder.GetFileAsync(sf.Name);
var readFile = await Windows.Storage.FileIO.ReadTextAsync(file);
nextFileContents = readFile.ToString();
break;
}
}
}
Upvotes: 2
Views: 1214
Reputation: 1
If you read Microsoft Documentation about access uSD on Windows 10 (here link) you have to do two tasks:
read the documentation and enjoy
Upvotes: 0