"Operation not permitted on IsolatedStorageFileStream." is pointing towards the line of codes:
var fileStream = storage.OpenFile(item.FileName, FileMode.Open, FileAccess.Read)
in the codes below:
private void OnReadSelected()
{
IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication();
List<FileItem> readItems = new List<FileItem>();
foreach (var item in Files)
{
if (item.IsChecked)
if (storage.FileExists(item.FileName))
{
storage.DeleteFile(item.FileName);
readItems.Add(item);
}
}
foreach (var item in readItems)
using (var fileStream = storage.OpenFile(item.FileName, FileMode.Open, FileAccess.Read))
{
using (var reader = new StreamReader(fileStream))
{
item.FileName = reader.ReadLine();
item.FileText1 = reader.ReadLine();
item.RdbText1 = reader.ReadLine();
}
}
}
Am I to use another derivative besides StreamReader?