使用VB应用阅读网页 [英] Read webpage with VB app
问题描述
是否有一种简单的方法来阅读(和解析)具有VB.net
应用程序的网页。现在我可以阅读一个页面,但它是一个框架页面和
服务器认为该应用程序是一个无法处理帧的浏览器...所以我得到一个
消息响应中的效果。
Ken
Is there a simple way to read (and parse) a webpage with a VB.net
application. Right now I can sort of read a page but it''s a framed page and
the server thinks the app is a browser that can''t handle frames...so I get a
message to the effect in the response.
Ken
推荐答案
*" KC" < yo*@dontneed.this> scripsit:
* "KC" <yo*@dontneed.this> scripsit:
是否有一种简单的方法来阅读(和解析)具有VB.net
应用程序的网页。现在我可以阅读一个页面,但它是一个框架页面和服务器认为该应用程序是一个无法处理框架的浏览器...所以我得到一个
消息给响应中的效果。
Is there a simple way to read (and parse) a webpage with a VB.net
application. Right now I can sort of read a page but it''s a framed page and
the server thinks the app is a browser that can''t handle frames...so I get a
message to the effect in the response.
您可以加载每个框架的HTML页面。这将要求您知道
文件名或解析框架集。或者,您可以在表单上放置一个
WebBrowser控件并使用以下代码:
\\\
Me.WebBrowser1.Navigate(" http://www.over-the-moon.org/dollz")
///
WebBrowser''''DocumentComplete''事件处理程序:
\\\
Dim i As Integer
对于i = 0 To Me.WebBrowser1.Document.frames.length - 1
MsgBox(Me.WebBrowser1.Document.frames(i).Document。documentElement.innerText)
接下来我
///
-
Herfried K. Wagner [MVP]
< URL:http://dotnet.mvps.org/>
You can load each frame''s HTML page. This will require you to know the
filename or parse the frameset. Alternatively, you can place a
WebBrowser control on your form and use this code:
\\\
Me.WebBrowser1.Navigate("http://www.over-the-moon.org/dollz")
///
In the WebBrowser''s ''DocumentComplete'' event handler:
\\\
Dim i As Integer
For i = 0 To Me.WebBrowser1.Document.frames.length - 1
MsgBox(Me.WebBrowser1.Document.frames(i).Document. documentElement.innerText)
Next i
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
*" KC" < yo*@dontneed.this> scripsit:
* "KC" <yo*@dontneed.this> scripsit:
是否有一种简单的方法来阅读(和解析)具有VB.net
应用程序的网页。现在我可以阅读一个页面,但它是一个框架页面和服务器认为该应用程序是一个无法处理框架的浏览器...所以我得到一个
消息给响应中的效果。
Is there a simple way to read (and parse) a webpage with a VB.net
application. Right now I can sort of read a page but it''s a framed page and
the server thinks the app is a browser that can''t handle frames...so I get a
message to the effect in the response.
您可以加载每个框架的HTML页面。这将要求您知道
文件名或解析框架集。或者,您可以在表单上放置一个
WebBrowser控件并使用以下代码:
\\\
Me.WebBrowser1.Navigate(" http://www.over-the-moon.org/dollz")
///
WebBrowser''''DocumentComplete''事件处理程序:
\\\
Dim i As Integer
对于i = 0 To Me.WebBrowser1.Document.frames.length - 1
MsgBox(Me.WebBrowser1.Document.frames(i).Document。documentElement.innerText)
接下来我
///
-
Herfried K. Wagner [MVP]
< URL:http://dotnet.mvps.org/>
You can load each frame''s HTML page. This will require you to know the
filename or parse the frameset. Alternatively, you can place a
WebBrowser control on your form and use this code:
\\\
Me.WebBrowser1.Navigate("http://www.over-the-moon.org/dollz")
///
In the WebBrowser''s ''DocumentComplete'' event handler:
\\\
Dim i As Integer
For i = 0 To Me.WebBrowser1.Document.frames.length - 1
MsgBox(Me.WebBrowser1.Document.frames(i).Document. documentElement.innerText)
Next i
///
--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
嗨KC,
除了Herfried,
一个小例子,
打开一个新的Windows应用程序项目
工具箱右键单击并选择添加/删除项目
在自定义工具箱中选择Com并在其中Microsoft W ebbrowser
当它在工具箱中时,将其拖到表单上
拖动一个按钮到你的表格。
然后这个代码,你有一个迷你Web浏览器。
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As
System.EventArgs)处理Button1.Click
Me.AxWebBrowser1.Navigate2(" www.google.com")
End Sub
webbrowser
http://support.microsoft.com/?kbid=311303
mshtml
http://msdn.microsoft.com/library/de...ng/hosting.asp
我希望这有点帮助吗?
Cor
Hi KC,
In addition to Herfried,
A little example,
Open a new windows application project
In the toolbox rightclick and select add/Remove items
In the customize toolbox select Com and in that Microsoft Webbrowser
When that is in the toolbox drag it to your form
Drag also a button to your form.
Then this code and you have a mini Webbrowser.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Me.AxWebBrowser1.Navigate2("www.google.com")
End Sub
webbrowser
http://support.microsoft.com/?kbid=311303
mshtml
http://msdn.microsoft.com/library/de...ng/hosting.asp
I hope this helps a little bit?
Cor
这篇关于使用VB应用阅读网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!