1

我在 windows phone 8 中有网络浏览器控件。我想在我的网络浏览器控件中加载 html

我的 html 字符串是

string htmlstring=
   " <html>
    <head>
    <title>Kayako chat</title>
    </head>
    <body><!-- BEGIN FUSION TAG CODE - DO NOT EDIT! -->
    <div>
    <div id=\"proactivechatcontainer6bahdzbxzq\">
    </div>
    <table border=\"0\" cellspacing=\"2\" cellpadding=\"2\">
    <tr><td align=\"center\" id=\"swifttagcontainer6bahdzbxzq\">
    <div style=\"display: inline;\" id=\"swifttagdatacontainer6bahdzbxzq\">
    </div>
    </td></tr>
    </table>
    </div>
    <script type=\"text/javascript\">
    var swiftscriptelem6bahdzbxzq=document.createElement(\"script\");
    swiftscriptelem6bahdzbxzq.type=\"text/javascript\";
    var swiftrandom = Math.floor(Math.random()*1001); 
    var swiftuniqueid = \"6bahdzbxzq\"; 
    var swifttagurl6bahdzbxzq=\"http://kcs.kayako.com/visitor/index.php?/Default/LiveChat/HTML/HTMLButton/cHJvbXB0dHlwZT1jaGF0JnVuaXF1ZWlkPTZiYWhkemJ4enEmdmVyc2lvbj00LjUzLjI2MzMmcHJvZHVjdD1GdXNpb24mY3VzdG9tb25saW5lPWh0dHAlM0ElMkYlMkZrY3Mua2F5YWtvLmNvbSUyRl9fc3dpZnQlMkZmaWxlcyUyRmZpbGVfY3ViOWcyZXJiZ21yYTM2LnBuZyZjdXN0b21vZmZsaW5lPWh0dHAlM0ElMkYlMkZrY3Mua2F5YWtvLmNvbSUyRl9fc3dpZnQlMkZmaWxlcyUyRmZpbGVfMGdrOWo4a3Q2a21ubjljLnBuZyZjdXN0b21hd2F5PWh0dHAlM0ElMkYlMkZrY3Mua2F5YWtvLmNvbSUyRl9fc3dpZnQlMkZmaWxlcyUyRmZpbGVfc25nMDRlcmI0cnhnZGZpLnBuZyZjdXN0b21iYWNrc2hvcnRseT1odHRwJTNBJTJGJTJGa2NzLmtheWFrby5jb20lMkZfX3N3aWZ0JTJGZmlsZXMlMkZmaWxlXzAwZWw3bHAxaDBoZXRtZy5wbmcKYjIxOWVhMTFkMWQ1ZDA4ZmM2NWQyMTBkOTFmN2JkYjk2NjExNjNhYQ==\";
    setTimeout(\"swiftscriptelem6bahdzbxzq.src=swifttagurl6bahdzbxzq;
    document.getElementById('swifttagcontainer6bahdzbxzq').appendChild(swiftscriptelem6bahdzbxzq);\",1);
    </script><!-- END FUSION TAG CODE - DO NOT EDIT! -->
    </html>";

我做了这个但没有工作

var htmlCode = HttpUtility.HtmlDecode(htmlString);
WebView1.NavigateToString(htmlCode);
4

1 回答 1

0

最好的方法:

webbrowser1.documenttext = "Html"

如果它不工作:

        wb.Navigate("");
        do
        {
            Application.DoEvents();
        } while ((wb.ReadyState != WebBrowserReadyState.Complete));
        wb.Document.Body.InnerHtml = "Html";
于 2013-05-20T22:00:37.360 回答