Is there any way that I could get the source of a website (as a string preferably), let\'s say www.google.com, from some c# code inside code behind of asp.net website?
class Program
{
static void Main(string[] args)
{
using (WebClient client = new WebClient())
using (Stream stream = client.OpenRead("http://www.google.com"))
using (StreamReader reader = new StreamReader(stream))
{
Console.WriteLine(reader.ReadToEnd());
}
}
}