VB Webbrowser 网页编码
各路大神 求救
Private Sub Form_Load()
w1.Navigate "about:blank"
html = "<html><head><title>Live!</title><meta http-equiv=""Content-Type"" content=""text/html; charset=gb2312""></head><body><script id=""SINARSSNEWS"" name=""SINARSSNEWS"" src=""http://rss.sina.com.cn/my_sina_web_rss_news.js?border=news|marquee|ddt&display=1&number=0&hight=400&width=500&length=0&css=0&size=0&guide=0""></script></body></html>"
End Sub
Private Sub W1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
w1.Document.write html
End Sub
就是用webbrowser.document.write写了个页面,但是显示的编码有问题啊,而且在网页里还改不了编码
[解决办法]
在webbrowser的statusTextChange事件中添加如下代码:
Private Sub W1_StatusTextChange(ByVal Text As String) If W1.LocationURL = "http:///" Then W1.Document.Charset = "gb2312" End IfEnd Sub