Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In my app I need to download an html page to be displayed in a WebView controll. I have seen the tutorial where I load an html file stored in solituion folder, but I need to display the file from a localStorage folder like this:

C#
ApplicationData.Current.LocalFolder.GetFolderAsync("HtmFolder");
var file = await localFolder.GetFileAsync("index.html");


Both the file and the folder exists.
So how can I display index.html in a WebView control?

What I have tried:

I have tried this, but I dont know what to put inside the uri:

C#
Uri uri = Browser.BuildLocalStreamUri("MyTag", "file.Path"); // this throws an exception
var file = StorageFile.GetFileFromApplicationUriAsync(uri);
StreamUriWinRTResolver resolver = new StreamUriWinRTResolver();
Browser.NavigateToLocalStreamUri(uri, resolver);
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900