use the following code:
url - the url of the file to be downloaded.
// Create a request to the URL.
WebRequest request = WebRequest.Create(url);
// Get response from the request made, as a stream
WebResponse response = request.GetResponse();
Stream stream = response.GetResponseStream();
StreamReader reader = new StreamReader(stream);
// read the content of the stream as a string.
string content = reader.ReadToEnd();
// save the same in a temp file.
"Chris Morrison"
<chris-[NO-SPAM]morrison@rassalom-[SPAM_BLOCK]technology.co.uk> wrote in
message news:eo**************@TK2MSFTNGP09.phx.gbl...
Hi all,
Can anyone tell me which .NET class I need (or provide a code sample) to
download file from a website/url (Not FTP) and save it to my hard drive.
Kind regards,
Chris