WebBrowser控件的原始源代码 [英] Raw Source Code of the WebBrowser Control

查看:77
本文介绍了WebBrowser控件的原始源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在我的应用程序中使用WebBrowser控件

WebBrowser导航到URL

http://feeds.bbci.co.uk/news/rss.xml [ ^ ]

一旦WebBrowser的Document Completed事件被触发,我将通过MessageBox.s(WebBrowser1.DocumentText)显示源代码;

看来显示的源代码与实际的不同

显示的代码包含html标签,其中url是XML文件的

我需要的是与XML中相同的文本

要记住的一件事是,我确实需要使用webbrowser控件,我尝试了httpwebrequest,webclient等都无法正常工作,只有webbrowser能够获取XML页面,但是它将其呈现为HTML,所以我无法获取实际的xml

希望获得soem帮助.

i am using WebBrowser Control in my application

the WebBrowser Navigates to the url

http://feeds.bbci.co.uk/news/rss.xml[^]

once the Document Completed Event of WebBrowser is Fired, i am showing the source code by MessageBox.s(WebBrowser1.DocumentText);

by it appears that the shown source code is different than actual

shown code contains html tags where as the url is of an XML file

what i need is the same text as it is in XML

one thing to remember, i do need to use webbrowser control, i have tried httpwebrequest, webclient etc none work, only webbrowser is able to get the XML page but it renders it to HTML so i cant get actual xml

hoping to get soem help

推荐答案

您真的需要WebBrowser控件吗?如果不想显示嵌入在应用程序中的网页,则最好使用 WebClient [ ^ ]类.
另请参阅:
http://www.dotnetperls.com/webclient [使用.NET WebClient进行HTTP GET [ http://www.geekpedia.com/tutorial147_Creating-an-RSS-feed- reader-in-Csharp.html [ ^ ].
Do you really need WebBrowser control? If you don''t want to show a web page embedded in your application, you better use WebClient[^] class.
See also:
http://www.dotnetperls.com/webclient[^]
HTTP GET with .NET WebClient[^]
Or even better, read the xml directly:
http://www.geekpedia.com/tutorial147_Creating-an-RSS-feed-reader-in-Csharp.html[^].


看看这些链接..
http://blorgh.wordpress.com/2006/10 /17/displaying-xml-in-the-net-webbrowser-control/ [ http://social.msdn.microsoft.com/Forums/en/winforms/thread/18ca6734-ddb7-4f44-a77c-9a7713dcc2e1 [
have a look at these links..
http://blorgh.wordpress.com/2006/10/17/displaying-xml-in-the-net-webbrowser-control/[^]
and
http://social.msdn.microsoft.com/Forums/en/winforms/thread/18ca6734-ddb7-4f44-a77c-9a7713dcc2e1[^]


这篇关于WebBrowser控件的原始源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆