See the following code,
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Net;
namespace DownloadingFile
{
class Program
{
static void Main(string[] args)
{
WebRequest reqFile = WebRequest.Create("http://www.codecollege.net/2009/07/cloud-computing.html");
WebResponse resFile = reqFile.GetResponse();
Stream smFile = resFile.GetResponseStream();
// Output the downloaded stream to the console
StreamReader sr = new StreamReader(smFile);
string line;
while ((line = sr.ReadLine()) != null)
Console.WriteLine(line);
Console.Read();
}
}
}
How to download webpage using asp.net and c# ?
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment