PC Review


Reply
Thread Tools Rate Thread

Can web page contents be retrieved?

 
 
needin4mation@gmail.com
Guest
Posts: n/a
 
      22nd Sep 2005
Hi, I was trying to find the right set of objects to retrieve a web
page and display its contents. I don't want to display the page, just
the HTML. I used to use XMLHTTP Request, but I don't see a lot of
examples with .net and c#, so I thought it must have been replaced with
something else. Any help is appreciated. Thanks.

 
Reply With Quote
 
 
 
 
Morten Wennevik
Guest
Posts: n/a
 
      22nd Sep 2005
Hi needin4mation,

To retrieve information from an URL, simply use a WebClient or the more complext HttpWebRequest/HttpWebResponse.


WebClient client = new WebClient();
byte[] data = client.DownloadData("www.contoso.com");

string html = Encoding.Utf8.GetString(data);



On Thu, 22 Sep 2005 18:22:51 +0200, <(E-Mail Removed)> wrote:

> Hi, I was trying to find the right set of objects to retrieve a web
> page and display its contents. I don't want to display the page, just
> the HTML. I used to use XMLHTTP Request, but I don't see a lot of
> examples with .net and c#, so I thought it must have been replaced with
> something else. Any help is appreciated. Thanks.
>
>




--
Happy coding!
Morten Wennevik [C# MVP]
 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Page Numbers in Table of Contents run off the page Phil Microsoft Word Document Management 2 22nd Mar 2009 06:21 PM
How do I keep contents to one page but fill up the whole page? Ebony Microsoft Access 0 11th Dec 2007 03:51 PM
In Office 2003 Can I link to a page No from a Contents page =?Utf-8?B?QmlsbCBMb3Vkb24=?= Microsoft Word Document Management 1 25th Oct 2006 02:13 PM
How do I update page numbers on a contents page without using TOC? =?Utf-8?B?Qmlnc3dlaXJndXJ1?= Microsoft Word Document Management 8 11th Jul 2006 05:00 PM
How do I update page numbers on a contents page without using TOC? =?Utf-8?B?Qmlnc3dlaXJndXJ1?= Microsoft Word Document Management 0 11th Jul 2006 03:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:40 PM.