I add .xml file to my roject. Now I need to open it. I try FileStream, StreamReader, IsolatedStorageFileStream. But there are get exception in each case. Somebody know how can i open local xml file and get data from it?
public static AllFlags Load()
{
IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication();
AllFlags allFlags;
IsolatedStorageFileStream stream = storage.OpenFile(filename, FileMode.Open);
//StreamReader stream = new StreamReader(filename);
XmlSerializer xml = new XmlSerializer(typeof(AllFlags));
allFlags = xml.Deserialize(stream) as AllFlags;
stream.Close();
stream.Dispose();
return allFlags;
}