Question

In a WPF Application got a WebBrowser and I want it to navigate using a isolated storage file as source.

If I pass a relative path it will complain. I've also ried using "ms-appdata:" and "isostore:" to build the URI but nothing seems to work.

I can't use the NavigateToString as I need JS files to be run as well and they're also store on the isolated space.

Any idea? Thanks!

Was it helpful?

Solution

What we've finally used is this piece of code:

    Uri url = new Uri("file:///" + rootdir + uri.ToString(), UriKind.Absolute);                    
    this.wbControl.Navigate(url);

where rootdir is got by the following method:

    public string GetRootDir()
    {
        Type type = isoStore.GetType();
        FieldInfo field = type.GetField("m_RootDir", System.Reflection.BindingFlags.NonPublic | BindingFlags.Instance);
        string rootDir = field.GetValue(isoStore).ToString();
        return rootDir;
    }

But the main problem is that using file:/// does not allow to use html5 localstorage object...

Any other idea?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top