Richard
Richard

Reputation: 43

Where are my files created by IsolatedStorageFileStream?

I would like to debug an IsolatedStorageFileStream generated xml file. Where do I find the file?

Upvotes: 3

Views: 4418

Answers (2)

Mick N
Mick N

Reputation: 14882

I'm assuming since you've tagged the question WP7 you're looking for the file on a Windows Phone.

The only way to inspect the file at present is to read it via the SDK. You could do something like this for example.

var stream = isoStore.OpenFile("whateverpathyou.gaveit",FileMode.Open);
var reader = new StreamReader(stream);
var output = reader.ReadToEnd();
System.Diagnostics.Debug.WriteLine(output);

Upvotes: 2

ShahidAzim
ShahidAzim

Reputation: 1494

Physical location is:

Windows 7 / 2008:

<SYSTEMDRIVE>\Users\<user>\Local Settings\Application Data\IsolatedStorage

Windows XP, Windows Server 2003:

<SYSTEMDRIVE>\Documents and Settings\<user>\Application Data\IsolatedStorage

Programmatic access is (only check the existance of the file, other examples are available from the link provided at the end):

const string ISOLATED_FILE_NAME = "MyIsolatedFile.txt";

IsolatedStorageFile isoStore = 
  IsolatedStorageFile.GetStore( IsolatedStorageScope.User 
  | IsolatedStorageScope.Assembly, null, null );

string[] fileNames = isoStore.GetFileNames( ISOLATED_FILE_NAME );

foreach ( string file in fileNames )
{
    if ( file == ISOLATED_FILE_NAME )
    {
       Debug.WriteLine("The file already exists!");
    }
}

Extracted from:

http://www.codeproject.com/KB/dotnet/IsolatedStorage.aspx

Upvotes: 6

Related Questions