Blog
Retrieving content of other page using C#
Below code will be useful if you want to read the content of some other page
Import class
<%@ Import Namespace="System.Net" %>
code:
System.Net.WebClient
Http = new System.Net.WebClient();
try
{
byte[] Result = Http.DownloadData("http://www.google.com");
string Content =
Encoding.Default.GetString(Result);
Response.Write(Encoding.Default.GetString(Result));
}
catch (Exception
ex)
{
Response.Write(ex.Message);
}
Response.End();
Any suggestion, changes or modification are welcome.