locked
Load embeded html in explorer (not WebView) RRS feed

  • Question

  • I have an application which can open some webpages (related to in-app content) in internet explorer.
    It works ok by using:
    Windows.System.Launcher.LaunchUriAsync(new Uri("web_page_url"));

    But now (for demo presentation) I need to mimic/fake this functionality at place where isn't accessible wi-fi or other internet connection.

    So I want to open files, which are as Content in appx,  in internet explorer. Is this possible?

    I tried
    Windows.System.Launcher.LaunchUriAsync(new Uri("ms-appx-web:///Assets/MyFile.htm"));
    but I get only "No apps are instaled to open this type of link"
    even I tried the worst case and open files directly form filesystem, eg:
    Windows.System.Launcher.LaunchUriAsync(new Uri(@"\Temp\MyFile.html"));
    Windows.System.Launcher.LaunchUriAsync(new Uri(@"file:///Libraries/Documents/MyFile.html");

    Using WebView, it works for me, by use
    WebView.Navigate(new Uri(@"ms-appx-web:///Assets/MyFile.htm"));
    but I want open it in external viewer (internet explorer) to utilize Snapped view.

    Thanks for any info.

    Monday, November 26, 2012 12:01 AM

Answers

  • Hi,

    Try this:

    StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///htm/Bing.htm"));
                await Windows.System.Launcher.LaunchFileAsync(file);

    Hope this helps

    Aaron Xue [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Wednesday, November 28, 2012 11:25 AM

All replies