Search code examples
isolatedstorage

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


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


Solution

  • 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);