gpt4 book ai didi

javascript - 如何另存为html文件,嵌入浏览器显示?

转载 作者:行者123 更新时间:2023-11-27 22:54:05 25 4
gpt4 key购买 nike

我已经通过添加到 html 文件来升级 VS 2019 WebBrowser 控件的性能,感谢 https://weblog.west-wind.com/posts/2011/may/21/web-browser-control-specifying-the-ie-version .作为备份,我也有 Geckofx 45 工作。根据我所阅读的内容,没有人可以将显示的内容保存为 html 文件,这正是我所需要的。有人可以引导我找到解决方案吗?

最佳答案

感谢 Jimi 和以下两个帖子:https://weblog.west-wind.com/posts/2011/may/21/web-browser-control-specifying-the-ie-version . Save WebBrowser Control Content to HTML我有一个很好的解决方案。有必要导入 System.IO 和导入 System.Text。这是代码:

Private Sub BtHTML_Click(sender As Object, e As EventArgs) Handles BtHTML.Click
Dim htmlFile As String = "C:\users\name\fileName"
File.WriteAllText(htmlFile, WebBrowser1.Document.Body.Parent.OuterHtml, Encoding.GetEncoding(WebBrowser1.Document.Encoding))
End Sub

关于javascript - 如何另存为html文件,嵌入浏览器显示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59330049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com