{"id":48929,"date":"2024-03-18T15:42:37","date_gmt":"2024-03-18T07:42:37","guid":{"rendered":"https:\/\/www.yimenapp.com\/kb-yimen\/?p=48929"},"modified":"2024-03-18T15:42:37","modified_gmt":"2024-03-18T07:42:37","slug":"win10%e6%a1%8c%e9%9d%a2%e5%ba%94%e7%94%a8html%e5%bc%80%e5%8f%91%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenapp.com\/kb-yimen\/48929\/","title":{"rendered":"win10\u684c\u9762\u5e94\u7528html\u5f00\u53d1\u4ecb\u7ecd"},"content":{"rendered":"<p>Win10<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%a1%8c%e9%9d%a2\/\" title=\"\u684c\u9762\" target=\"_blank\">\u684c\u9762<\/a><\/span>\u5e94\u7528HTML\u662f\u4e00\u79cd\u57fa\u4e8eWeb\u6280\u672f\u7684\u684c\u9762<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e5%ba%94%e7%94%a8%e7%a8%8b%e5%ba%8f\/\" title=\"\u5e94\u7528\u7a0b\u5e8f\" target=\"_blank\">\u5e94\u7528\u7a0b\u5e8f<\/a><\/span>\u5f00\u53d1\u65b9\u5f0f\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u7b49Web\u5f00\u53d1\u6280\u672f\u6765\u5f00\u53d1\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdWin10\u684c\u9762\u5e94\u7528HTML\u7684\u539f\u7406\u548c\u5f00\u53d1\u65b9\u5f0f\u3002<\/p>\n<p>\u4e00\u3001Win10\u684c\u9762\u5e94\u7528HTML\u7684\u539f\u7406<\/p>\n<p>Win10\u684c\u9762\u5e94\u7528HTML\u662f\u57fa\u4e8eUniversal Windows Platform (UWP)\u7684\u4e00\u79cd\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u65b9\u5f0f\u3002UWP\u662f\u4e00\u79cd\u901a\u7528\u7684\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u5e73\u53f0\uff0c\u5b83\u53ef\u4ee5\u5728\u4e0d\u540c\u7684Windows 10\u8bbe\u5907\u4e0a\u8fd0\u884c\uff0c\u5305\u62ec\u684c\u9762\u7535\u8111\u3001\u5e73\u677f\u7535\u8111\u3001\u624b\u673a\u3001Xbox\u7b49\u3002Win10\u684c\u9762\u5e94\u7528HTML\u662f\u5728UWP\u5e73\u53f0\u4e0a\u57fa\u4e8eWeb\u6280\u672f\u7684\u4e00\u79cd\u5f00\u53d1\u65b9\u5f0f\u3002<\/p>\n<p>Win10\u684c\u9762\u5e94\u7528HTML\u4f7f\u7528\u4e86WebView<span class=\"wpcom_tag_link\"><a href=\"https:\/\/www.yimenapp.com\/kb-yimen\/tag\/%e6%8e%a7%e4%bb%b6\/\" title=\"\u63a7\u4ef6\" target=\"_blank\">\u63a7\u4ef6<\/a><\/span>\u6765\u52a0\u8f7dHTML\u3001CSS\u548cJavaScript\u7b49Web\u9875\u9762\u3002WebView\u662f\u4e00\u79cd\u57fa\u4e8eEdge\u6d4f\u89c8\u5668\u5f15\u64ce\u7684\u63a7\u4ef6\uff0c\u5b83\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5d4c\u5165Web\u9875\u9762\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u5728WebView\u63a7\u4ef6\u4e2d\u52a0\u8f7dHTML\u3001CSS\u548cJavaScript\u7b49Web\u9875\u9762\uff0c\u5e76\u901a\u8fc7JavaScript\u4e0e\u5e94\u7528\u7a0b\u5e8f\u8fdb\u884c\u4ea4\u4e92\u3002<\/p>\n<p>\u4e8c\u3001Win10\u684c\u9762\u5e94\u7528HTML\u7684\u5f00\u53d1\u65b9\u5f0f<\/p>\n<p>Win10\u684c\u9762\u5e94\u7528HTML\u7684\u5f00\u53d1\u65b9\u5f0f\u4e0eWeb\u5f00\u53d1\u975e\u5e38\u76f8\u4f3c\uff0c\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u7b49Web\u5f00\u53d1\u6280\u672f\u6765\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\u3002\u4e0b\u9762\u4ecb\u7ecdWin10\u684c\u9762\u5e94\u7528HTML\u7684\u5f00\u53d1\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u521b\u5efaUWP\u9879\u76ee<\/p>\n<p>\u9996\u5148\u9700\u8981\u521b\u5efa\u4e00\u4e2aUWP\u9879\u76ee\uff0c\u53ef\u4ee5\u5728Visual Studio\u4e2d\u9009\u62e9\u201c\u65b0\u5efa\u9879\u76ee\u201d-&gt;\u201cVisual C#\u201d-&gt;\u201cWindows Universal\u201d-&gt;\u201c\u7a7a\u767d\u5e94\u7528\u7a0b\u5e8f\u201d\u6765\u521b\u5efa\u4e00\u4e2a\u7a7a\u767d\u7684UWP\u9879\u76ee\u3002<\/p>\n<p>2. \u6dfb\u52a0WebView\u63a7\u4ef6<\/p>\n<p>\u5728XAML\u6587\u4ef6\u4e2d\u6dfb\u52a0\u4e00\u4e2aWebView\u63a7\u4ef6\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p><p>&#8220;`<\/p>\n<p>3. \u52a0\u8f7dWeb\u9875\u9762<\/p>\n<p>\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528WebView\u63a7\u4ef6\u7684Navigate\u65b9\u6cd5\u6765\u52a0\u8f7dWeb\u9875\u9762\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>webView.Navigate(new Uri(&#8220;http:\/\/www.example.com&#8221;));<\/p>\n<p>&#8220;`<\/p>\n<p>4. \u4e0e\u5e94\u7528\u7a0b\u5e8f\u4ea4\u4e92<\/p>\n<p>\u5728Web\u9875\u9762\u4e2d\u53ef\u4ee5\u901a\u8fc7JavaScript\u4e0e\u5e94\u7528\u7a0b\u5e8f\u8fdb\u884c\u4ea4\u4e92\uff0c\u53ef\u4ee5\u4f7f\u7528WebView\u63a7\u4ef6\u7684ScriptNotify\u4e8b\u4ef6\u6765\u63a5\u6536JavaScript\u53d1\u9001\u7684\u6d88\u606f\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>webView.ScriptNotify += WebView_ScriptNotify;<\/p>\n<p>private void WebView_ScriptNotify(object sender, NotifyEventArgs e)<\/p>\n<p>{<\/p>\n<p>    \/\/ \u5904\u7406JavaScript\u53d1\u9001\u7684\u6d88\u606f<\/p>\n<p>}<\/p>\n<p>&#8220;`<\/p>\n<p>\u5728Web\u9875\u9762\u4e2d\u53ef\u4ee5\u901a\u8fc7window.external.notify\u65b9\u6cd5\u6765\u53d1\u9001\u6d88\u606f\u7ed9\u5e94\u7528\u7a0b\u5e8f\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<p>&#8220;`<\/p>\n<p>window.external.notify(&#8216;message&#8217;);<\/p>\n<p>&#8220;`<\/p>\n<p>5. \u6253\u5305\u5e94\u7528\u7a0b\u5e8f<\/p>\n<p>\u5728Visual Studio\u4e2d\u53ef\u4ee5\u4f7f\u7528\u201c\u751f\u6210\u201d-&gt;\u201c\u751f\u6210<a href=\"https:\/\/exe.yimenapp.com\/tool-2253.html\">web\u8f6cexe<\/a>\u89e3\u51b3\u65b9\u6848\u201d\u6765\u751f\u6210\u5e94\u7528\u7a0b\u5e8f\uff0c\u751f\u6210\u7684\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u5728Windows 10\u8bbe\u5907\u4e0a\u8fd0\u884c\u3002<\/p>\n<p>\u4e09\u3001\u603b\u7ed3<\/p>\n<p>Win10\u684c\u9762\u5e94\u7528HTML\u662f\u4e00\u79cd\u57fa\u4e8eWeb\u6280\u672f\u7684\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u65b9\u5f0f\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u7b49Web\u5f00\u53d1\u6280\u672f\u6765\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\u3002Win1<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.yimenyun.net\/2023-03\/29\/14\/03898479022.jpg\" \/><\/figure><\/p>\n<p>0\u684c\u9762\u5e94\u7528HTML\u4f7f\u7528\u4e86WebView\u63a7\u4ef6\u6765\u52a0\u8f7dWeb\u9875\u9762\uff0c\u5e76\u901a\u8fc7JavaScript\u4e0e\u5e94\u7528\u7a0b\u5e8f\u8fdb\u884c\u4ea4\u4e92\u3002\u5f00\u53d1\u8005\u53ef\u4ee5\u4f7f\u7528V<a href=\"https:\/\/exe.yimenapp.com\/tool-1952.html\">\u7f51\u7ad9\u600e\u4e48\u6253\u5305\u6210dmg<\/a>isual Studio\u6765\u521b\u5efaUWP\u9879\u76ee\uff0c\u5e76\u5728\u9879\u76ee\u4e2d\u4f7f\u7528WebView\u63a7\u4ef6\u6765\u5f00\u53d1\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Win10\u684c\u9762\u5e94\u7528HTML\u662f\u4e00\u79cd\u57fa\u4e8eWeb\u6280\u672f\u7684\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u65b9\u5f0f\uff0c\u5b83\u5141\u8bb8\u5f00\u53d1\u8005\u4f7f\u7528HTML\u3001CSS\u548cJavaScript\u7b49Web\u5f00\u53d1\u6280\u672f\u6765\u5f00\u53d1\u684c\u9762\u5e94\u7528\u7a0b\u5e8f\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdWin10\u684c\u9762\u5e94\u7528HTM<\/p>\n","protected":false},"author":27,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[39882,2445,8372,5819,29064],"special":[],"attr":[],"class_list":{"0":"post-48929","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-zixun","7":"tag-exe","8":"tag-2445","9":"tag-8372","10":"tag-5819","12":"entry"},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/48929","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/users\/27"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/comments?post=48929"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/48929\/revisions"}],"predecessor-version":[{"id":48966,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/posts\/48929\/revisions\/48966"}],"wp:attachment":[{"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/media?parent=48929"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/categories?post=48929"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/tags?post=48929"},{"taxonomy":"special","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/special?post=48929"},{"taxonomy":"attr","embeddable":true,"href":"https:\/\/www.yimenapp.com\/kb-yimen\/wp-json\/wp\/v2\/attr?post=48929"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}