System.Net.WebClient.DownloadFile does not work all the time.

Discussion in 'Software' started by Girish_Kamalapur, Jun 23, 2013.

  1. Girish_Kamalapur

    Girish_Kamalapur

    Joined:
    Jun 23, 2013
    Messages:
    1
    Hi,

    I need to download the images from websites.
    I am using following code, in my ASP.Net application with framework 4.0.

    System.Net.WebClient wc = new System.Net.WebClient();
    wc.DownloadFile(finalPath, String.Format(destDir + "\\" + file));
    wc.Dispose();
    finalPath is holding the url of .gif file, destDir is my local folder and file is the name which I want to save the file as.
    This works some times, but most of the time all the down loaded image files (gif,jpg,png) have a same size and all images will be corrupt. It will not be possible to see the images in preview.
    What I am missing here?
    Is there any other was to download the image using .Net code?
    Is there any setting need to be changed?

    Thank you for the help in advance.
    Regards,
    Girish.
    Girish_Kamalapur, Jun 23, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DerekB
    Replies:
    0
    Views:
    558
    DerekB
    Nov 10, 2005
  2. Cowboy \(Gregory A. Beamer\)

    Take MCSD.NET with VB.NET and C#.NET in the same time?

    Cowboy \(Gregory A. Beamer\), Jan 1, 2004, in forum: MCSD
    Replies:
    1
    Views:
    409
    The Fox
    Jan 1, 2004
  3. Si

    WebClient/Publisher Temporary Files

    Si, Jun 26, 2004, in forum: Computer Support
    Replies:
    6
    Views:
    11,740
  4. Me

    SIP webclient??

    Me, Aug 31, 2004, in forum: VOIP
    Replies:
    3
    Views:
    7,327
    voipd
    Jan 13, 2009
  5. Bucky Breeder

    ![Oof Topix] All McCain, All Flip-Flop, All the Time

    Bucky Breeder, Sep 27, 2008, in forum: Computer Support
    Replies:
    7
    Views:
    601
    HEMI-Powered
    Sep 27, 2008
Loading...

Share This Page