Files in the installation package:
Windows Phone 8 can directly access the files in the installation package in the form of a relative path, "apps/readme.txt ". For example, filestream stream = file. openread ("apps/readme.txt"); you can also use the following method:
String installpath = windows. ApplicationModel. Package. Current. installedlocation. Path ;;
String Path = path. Combine (installpath, "apps/readme.txt ");
Filestream stream = file. openread (PATH );
The navigate method of webbrowser can only use the "apps/readme.txt" format, for example:
Webbrowser browser = new webbrowser ();
Uri url = new uri ("html/index.html", urikind. Relative );
Browser. navigate (URI );
Files in the independent storage zone:
For access to the independent storage area, you must use isolatedstoragefile mystore = isolatedstoragefile. getuserstoreforapplication (); or use string localpath = applicationdata. Current. localfolder. Path; you cannot directly use the relative path.
However, for the webbrowserr navigate method to access files in the independent storage area, you can only use the relative path:
Webbrowser browser = new webbrowser ();
Uri url = new uri ("html/index.html", urikind. Relative );
Browser. navigate (URI );
That is to say, the relative path must be used to access the installation package and the independent storage zone of webbrowser.
In this way, when the installation package and the independent storage area have the same file path, webbrowser will first access the files in the independent storage area.
Microsoft is so cool !! One word: "Chaos", I'm going crazy.