I read about the System.IO.IsolatedStorage namespace in .NET and found that I could use it to store the file in a place unique to my build or executable. For example, the following code:
using System.IO.IsolatedStorage; public class Program { static void Main(string[] args) { IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForAssembly(); store.CreateFile("myUserFile.txt"); } }
Creates the file "myUserFile.txt" in the following location:
C: \ Users \ Nickname \ AppData \ Local \ IsolatedStorage \ bhxcjtkp.bpv \ wbjkcolm.3br \ StrongName.m2s0saaun2onmow3pd5pkml30lf2dobr \ AssemFiles
And using IsolatedStorageFile.GetMachineStoreForAssembly() creates a similar directory structure in C: \ ProgramData \ IsolatedStorage.
I see that you can let this API create a repository for you (no need to invent the path to the file yourself). But I was surprised to see that there were no other files stored in IsolStorage from other third-party applications (at least not on my computer).
Instead, I found quite a few programs that store configuration files, and simply in C: \ Users \ Nick \ AppData \ Local. Does anyone know why software vendors might shy away from using IsolStorage? Or do they use a different API that stores files in AppData?
Nick ramirez
source share