Understanding Isolated Storage - Day 3 - Part 6
- Posted: Nov 11, 2010 at 6:07 PM
- 23,824 Views
- 10 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Each Windows Phone 7 application is allocated space on the phone's flash drive where it can store information in a solitary area that cannot be accessed by other applications. The application can save any type of file or data here. In this video, Bob demonstrates how to utilize this feature to create new files or open existing files (like text files), read them, and display their information on the Phone's display.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Hi Bob
Where abouts is isolated storage found on the computer during wp7 emulation? This would be convenient to know for debugging.
Thanks,
Brendan
I am getting errors on the "IsolatedStorageFile" and "StreamWriter" items in the code. I have both verified the code is the same as the video and copied the Code from the MainPage.Xaml.cs source code and it still flags it as an error.
I'm also getting the same issues with IsolateStorageFile and StreamWriter :/
If you pause the video at 3:14, you can see that new code appears in lines 13 and 14. Adding the following code to lines 13 and 14 appears to solve the issue.
using System.IO.IsolatedStorage;
using System.IO;
this also brings up the (small) issue, that if someone were to get this exact example from the marketplace and click the "open" button before anything was saved, you would have the same issue as when restarting your phone emulator, i.e. the unhandled exception. make sure to use some kind of error-catching, or at least a simple if statement to check whether the file exists.
The thing is the data stored are not overwritten when a new data is stored. hence when the new data (e.g. 12345) has less characters than the previous data (e.g. 987654321), and when we recall the data, the part of the prvious data after the new data is recalled as well (e.g. 123454321).
So how do we completely clear out the previous data when the new data is stored?
Very cool indeed.
Great video series!!
My question relates to the saved file (simple.txt) and the open/recall function. When the user enters new information and saves it to the flash memory of the device, the old entry is not completely overwritten. The user has to termintate the program to completely clear the initial message from the flash memory. Is there a fix to this? If so, what is it? That would have been a great ending to this video...and helped me tremendously!
@Shawn: You need to delete the file before writing with something like
using
(IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForApplication())
{
storage.Remove();
}
Hi, i have a question:
if I switch off my phone after saved my file, when i restart the phone the file is deleted, clear, or is the same that i have svaed before?
Thanks
Remove this comment
Remove this thread
close