How do I obtain the full path of an isolated storage file
Asked Answered
D

2

5

How do I obtain the fully qualified path of an isolated storage file for a WPF application?

Demonolatry answered 23/9, 2010 at 18:35 Comment(0)
B
8

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);
Branscum answered 23/9, 2010 at 18:37 Comment(2)
Shouldn't it be possible to obtain the path using a Win32 call via the low-level handle?Demonolatry
@Demonolatry - you could probably PInvoke something like that, but I assumed you would be using managed code.Branscum
D
0

On Windows 10 Mobile the isolated-storage-path is equal to Windows.Storage.ApplicationData.Current.LocalFolder.

If you know the relative file-path inside the isolated-storage you can use System.IO.Path.Combine() to create the full path.

You can use IsolatedStorageFile.GetUserStoreForApplication().GetFileNames() to list all files in the isolated-storage.

Decalogue answered 29/10, 2015 at 14:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.