4

I'm developing windows store app using javascript, html5 and C#. I have developed functionality which downloads zip from web and extracts it to "AppData" folder in "C" drive. That zip file has HTML files. So my question is, I want to display that html in windows app.

I'm able to load html from web in iframe but not from local drive. I also tried to do it by giving absolute path in iframe but not working.

siraj pathan
  • 1,455
  • 1
  • 14
  • 31

2 Answers2

1

Basically, StoreApp's WebView can load the local resource from your app's local storage. "app's local storage" means.. Windows.Storage.Current.ApplicationData.Current.LocalFolder, etc.

If the resources are located outside of your app's local storage, you have 2 options:

  1. Copy the all resources to your local storage.
  2. Create a 'stream' that have all required resources, then give the stream to webview.

1 is easy. To refer your html resource, use following syntax.

  • ApplicationData.Current.LocalFolder - "ms-appdata:///local/hogehoge.html"
  • ApplicationData.Current.TemporaryFolder - "ms-appdata:///temp/foobar.html"
  • App packages file (like Asset) - "ms-appx-web:///Assets/boee.html"

2 is complicated. Below is an example for 2.

XAML WebView control sample

Mamoru Satoh
  • 2,670
  • 23
  • 23
0

Use webbrowser.NavigateToString("parameter"). Your question is a possible duplicate: Local HTML File - WebBrowser - Windows phone 7

Community
  • 1
  • 1
Matthias Herrmann
  • 2,650
  • 5
  • 32
  • 66