How do I obtain the fully qualified path of an isolated storage file for a WPF application?
Isolated storage generally uses one of three locations to read and write data: %LOCALAPPDATA%\IsolatedStorage\ : For example, C:\Users\<username>\AppData\Local\IsolatedStorage\ , for User scope. %APPDATA%\IsolatedStorage\ : For example, C:\Users\<username>\AppData\Roaming\IsolatedStorage\ , for User|Roaming scope.
You can delete directories and files within an isolated storage file. Within a store, file and directory names are operating-system dependent and are specified as relative to the root of the virtual file system. They are not case-sensitive on Windows operating systems.
You can use reflection to do so, as shown in the linked forum post:
IsolatedStorageFileStream oStream =
new IsolatedStorageFileStream(ISOLATED_FILE_NAME, FileMode.Create, isoStore);
// Get the physical path using reflection
String filePath = oStream.GetType().GetField("m_FullPath",
BindingFlags.Instance | BindingFlags.NonPublic).GetValue(oStream).ToString();
Console.WriteLine(filePath);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With