For isolated storage, I think everyone should be familiar with the following three methods:
- Isolatedstoragesettings
- Isolatedstoragefile
- Datacontext, that is, the database stores data
How to store data will be skipped. Here we will mainly summarize how to manage data in isolated buckets in Windows Phone programming. First, we will introduce the official management tools-[Isolated storage explorer tool]Isetool is a command line-based management tool (simple and cumbersome, so here is a brief introduction, and we will introduce third-party management tools later), which is included in the Windows Phone SDK, you can use isetool to view, copy, or replace files. We can use this tool to check whether the data storage location and file name are correct.
Usage of isolated storage explorer tool:
1. First, ensure the applicationProgramThe application is already installed on a simulator or physical device, and the simulator and physical device are in the running state;
2. Run c: \ Program Files \ microsoft sdks \ Windows Phone \ v7.1 \ tools \ isolatedstoragecyclertool \ isw.l.exe.
The syntax rules of the isolated storage explorer tool are as follows:
Isetool.exe <ts | Rs | dir [: Device-folder]> <XD | de> <product guid> [<desktop-path>]
For details about the parameters in these syntax rules, refer to the description in msdn. The following describes the usage. We will list the files in the isolated storage:
- Deploy applications to simulators or physical devices;
- Create folders or files in isolated storage;
- Obtain the product guid in the wpappmanifest. xml file;
- In the command line window, enter the isw.l.exe folder;
- Enter the query command. The result is shown in.
Other operation commands are similar.
We can see that the official isetool is troublesome and not intuitive. Fortunately, we can use third-party visualization tools to query and manage data in isolated storage. There are mainly three tools:
- Windows Phone Power Tools
- Windows Phone isostorespy
- WP7 isolated storage Explorer
First, we will introduce Windows Phone Power Tools
This is a good tool and is very useful for developing and debugging Windows Phone programs.
: Http://wptools.codeplex.com/
Function Description:
A) install and deploy or update the xap file so that you can run some applications on the simulator;
B) view the xap files deployed in the system, uninstall or start the program;
C) file browser: You can view all files in isolated storage, including isolated storage settings and files.
Here we mainly use the file browser function. For example, we can easily and intuitively view the data in the isolated storage of simulators or physical devices. Each application's isolated bucket has a shared directory, which is also in the root directory. The following describes the functions of these directories.
The shared directory generally contains three subdirectories: Media, shellcontent, and transfers. The media directory can hold some audio files, such as playing music in the background with music and videos hub; shellcontent is related to application tiles, while the transfers directory is related to the data storage of the background proxy service, for example, downloading files in the background.
With Windows Phone power tools, we can view data in isolated storage for each application, transfer data to isolated storage, or copy data from isolated storage to a local device, which is very convenient to operate.
Next we will introduce Windows Phone isostorespy.
: Http://isostorespy.codeplex.com/
Function Description: The basic functions are very similar to those of Windows Phone power tools, but they are more powerful than Windows Phone Power Tools. For example, you can customize ringtones and view images and videos directly, however, it is powerful to view database information, which is useful when developing database-related applications.
For example, you can view the database information and execute SQL statements.
Last Introduction
WP7 isolated Explorer.
: Http://wp7explorer.codeplex.com/
Function Description: displays data in an isolated bucket, which is especially integrated with Visual Studio, for example.
The operation of this tool is still troublesome. We recommend that you use it.IsostorespyThis tool is used for auxiliary development.
Next, let's add how to ensure data consistency through semaphores when multiple threads request resources.