Click here to Skip to main content
Click here to Skip to main content

Tagged as

Get WebPage SourceCode

, 21 Apr 2011 CPOL
Rate this:
Please Sign up or sign in to vote.
you will need to add
using System.Net;
 
private static String webSource(String url)
            {
                return Encoding.ASCII.GetString(new WebClient().DownloadData(WebRequest.Create(url).GetResponse().ResponseUri));
            }
 
or you could also use
 
                private static String webSource(String url)
            {
                return Encoding.ASCII.GetString(new WebClient().DownloadData(url));
            }

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

charles henington

United States United States
I do not claim to be wrong! I just rarely ever write.

Comments and Discussions

 
GeneralMy vote of 5 Pinmembersource.compiler11-Feb-13 19:58 
GeneralNot all pages use ASCII encoding. You'd be better off using ... PinmemberRichard Deeming28-Apr-11 13:00 
Generalif your going to vote atleast leave a comment explaining the... Pinmembercharles henington22-Apr-11 5:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.150305.1 | Last Updated 21 Apr 2011
Article Copyright 2011 by charles henington
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid