Получение содержимого IsolatedStorageFile

Я пытаюсь создать метод для сериализации и десериализации файла данных, но у меня возникают некоторые ошибки.

System.InvalidOperationException: в XML-документе произошла ошибка (10, 10).

Есть ли способ получить содержимое файла данных, чтобы увидеть, что это может быть?

#if WINDOWS_PHONE
    IsolatedStorageFile dataFile = IsolatedStorageFile.GetUserStoreForApplication();
#else
    IsolatedStorageFile dataFile = IsolatedStorageFile.GetUserStoreForDomain();
#endif

try
{
    // Create an isolated storage stream and initialize it as null.
    IsolatedStorageFileStream isolatedFileStream = null;
    // Open the isolated storage stream, and write the save data file.
    if (dataFile.FileExists(filename))
    {
        using (isolatedFileStream = dataFile.OpenFile(filename, FileMode.Open, FileAccess.ReadWrite))
        {
            // Read the data from the file.
            XmlSerializer serializer = new XmlSerializer(typeof(Data));
            // Store each of the deserialized data objects in the list.
            Data savedData = (Data)serializer.Deserialize(isolatedFileStream);

0 ответов

Другие вопросы по тегам