Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows phone 8 在Windows Phone中从WebBrowser组件中的IsolatedStorage打开html文件_Windows Phone 8 - Fatal编程技术网

Windows phone 8 在Windows Phone中从WebBrowser组件中的IsolatedStorage打开html文件

Windows phone 8 在Windows Phone中从WebBrowser组件中的IsolatedStorage打开html文件,windows-phone-8,Windows Phone 8,我在IsolatedStorage中存储了一个HTML文件,名为test.HTML 在UI中,我有一个名为browser的WebBrowser组件。我正在使用以下代码在浏览器中显示网页: browser.Navigate(new Uri("isostore:/test.html", UriKind.Absolute)); 但是,它会提示我在应用商店中搜索应用程序,就好像我正在尝试使用LaunchUriAsync或LaunchFileAsync API 我想问题在于Uri格式。在这种情况下,正确

我在IsolatedStorage中存储了一个HTML文件,名为
test.HTML

在UI中,我有一个名为browser的
WebBrowser
组件。我正在使用以下代码在浏览器中显示网页:

browser.Navigate(new Uri("isostore:/test.html", UriKind.Absolute));
但是,它会提示我在应用商店中搜索应用程序,就好像我正在尝试使用
LaunchUriAsync
LaunchFileAsync API

我想问题在于Uri格式。在这种情况下,正确的Uri格式应该是什么

C:/Data/Users/DefApps/AppData/{43F7CB8F-D4CF-425D-96BD-CD96D3FF44DC}/Local/test.html
上面的路径是独立存储的另一条绝对路径。此字符串{43F7CB8F-D4CF-425D-96BD-CD96D3FF44DC}是应用程序特有的,但可以在visual studio项目的“属性”文件夹中设置/找到。您也可以通过使用C代码中的以下行来获得它:

上面的路径是独立存储的另一条绝对路径。此字符串{43F7CB8F-D4CF-425D-96BD-CD96D3FF44DC}是应用程序特有的,但可以在visual studio项目的“属性”文件夹中设置/找到。您也可以通过使用C代码中的以下行来获得它:


通过从Uri字符串中删除'isostore:/'前缀,我已经解决了这个问题。我知道,如果没有任何前缀,文件路径将指向应用程序文件夹,而不是独立存储。看来他们为WebBrowser组件破例了。 这就是现在的效果:

browser.Navigate(new Uri("test.html", UriKind.Relative));

通过从Uri字符串中删除'isostore:/'前缀,我已经解决了这个问题。我知道,如果没有任何前缀,文件路径将指向应用程序文件夹,而不是独立存储。看来他们为WebBrowser组件破例了。 这就是现在的效果:

browser.Navigate(new Uri("test.html", UriKind.Relative));

我试过上面的片段。但是,在调用browser.Navigate时(使用UriKind.Absolute),我遇到了一个异常,错误代码为80004005。我尝试了上面的代码段。但是,在调用browser.Navigate时(使用UriKind.Absolute),我得到一个异常,错误代码为80004005。可能重复的可能重复的