简体   繁体   中英

Win8/Metro: Url and Document in WebView control?

I am creating a metro-style version for one of my apps, coded in c#. I need to access a web page, get the url and html code from that page and then use them.

In the winforms version, i used a WebBrowser control and its properties, .Url and .Document.ActiveElement.OuterHtml/InnerHtml.

For the metro-style app, i used a WebView control to access the page but it doesn't have such properties and i can't find anywhere how to get the url and the html code.

Anybody knows how to do that? Thanks in advance!

Edit: something like this (winforms, C#):

webBrowser1.DocumentCompleted+=delegate
{
    if (webBrowser1.Url.ToString ().StartsWith ("http://www.google.com/"))
    {
        string url=webBrowser1.Url.ToString ();
        string htmlCode=webBrowser1.Document.ActiveElement.InnerHtml;
    }
};

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM