How can I remove 1 character off the end of a certain file in IsolatedStorage?
The code I have so far is:
var appStorage = IsolatedStorageFile.GetUserStoreForApplication();
using (var writer = new StreamWriter(appStorage.OpenFile("trailCount", FileMode.Truncate, FileAccess.Write)))
{
writer.Write(1);
}
However It doesn't seem to work.
Thanks
If you want to remove the last character you could do the following:
Additionaly, when opening the file, use
FileMode.Open
, otherwise whole file will be truncated.