PC Review


Reply
Thread Tools Rate Thread

Downloading a file from a website

 
 
Chris Morrison
Guest
Posts: n/a
 
      18th Dec 2003
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


 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      18th Dec 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:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
Cor
Guest
Posts: n/a
 
      18th Dec 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.
>



 
Reply With Quote
 
Vijayakrishna Pondala
Guest
Posts: n/a
 
      31st Dec 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:(E-Mail Removed)...
> 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
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
help on downloading a text file from a website into memory Dougsd1r Microsoft VB .NET 5 14th Mar 2008 11:43 PM
downloading a file from a website =?Utf-8?B?U2NvcnBpb2V0Mg==?= Windows XP Help 0 11th Mar 2007 04:36 AM
Downloading purchased music file from '3' website. =?Utf-8?B?YmFycnlwb3R0ZXI=?= Windows XP Music 4 28th Aug 2006 08:40 PM
Create a hyperlink for downloading a file from a website =?Utf-8?B?TWlrZSBT?= Microsoft Frontpage 6 16th Jul 2006 05:40 PM
Downloading a file from a website Chris Morrison Microsoft Dot NET Framework 3 31st Dec 2003 06:05 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:17 AM.