user222427
user222427

Reputation:

C# HTML Code Reader

what i'm trying to do this this. Simply create a C# windows app that when that when i point it to a website will download the HTML code. Kind of like when you use IE and you choose view source. Any starting point would be great.

Upvotes: 1

Views: 1114

Answers (5)

tdaines
tdaines

Reputation: 581

Have you looked into the WebClient class?

using(WebClient webClient = new WebClient())
{
    string html = webClient.DownloadString("http://www.someurl.com");
}

Upvotes: 2

Hun1Ahpu
Hun1Ahpu

Reputation: 3355

You should look for HttpWebRequest class. You can use it for making requests. Also take a look on a ready-made solution Watin

Upvotes: 0

Daniel Plaisted
Daniel Plaisted

Reputation: 16744

Have a look at the WebClient class.

Upvotes: 5

LBushkin
LBushkin

Reputation: 131806

You probably want to look into HttpWebRequest in .NET.

WebClient may be another class for you to explore.

It provides an HTTP specific implementation of WebRequest which can be used to download HTML (or any other content, really) using the HTTP protocol.

Upvotes: 3

Keltex
Keltex

Reputation: 26436

You could create a wrapper around wget, which already does all the heavy lifting.

Upvotes: 0

Related Questions