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

Re: Downloading a file from a website by Scott

Scott
Wed Dec 17 21:31:30 CST 2003

What do you want to do? You don't need .NET for that. <A
HREF="file.ext">Click to download</A>


"Chris Morrison"
<chris-[NO-SPAM]morrison@rassalom-[SPAM_BLOCK]technology.co.uk> wrote in
message news:eoUuXCRxDHA.2652@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
>
>



Re: Downloading a file from a website by Cor

Cor
Thu Dec 18 02:17:59 CST 2003

Hi Chris,

system.net.Webclient

Cor
>
> 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.
>



Re: Downloading a file from a website by Vijayakrishna

Vijayakrishna
Wed Dec 31 00:05:53 CST 2003

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:eoUuXCRxDHA.2652@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
>
>