unable to download http file

Discussion in 'ASP.NET' started by studentintau, Aug 19, 2007.

  1. studentintau

    studentintau New Member

    Joined:
    Aug 4, 2007
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    I would thank you if you help me with the next subject:

    I tried to download http file to c drive, but it did not work.

    Here is the code I wrote :
    Code:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Net;
    
    namespace t2
    {
        class Program
        {
            static void Main(string[] args)
            {
                WebRequestMethods.File.DownloadFile("http://www.eng.tau.ac.il/students/forms/t4.pdf", "c:");
            }
        }
    }
     
    Last edited by a moderator: Aug 20, 2007
  2. pradeep

    pradeep Team Leader

    Joined:
    Apr 4, 2005
    Messages:
    1,645
    Likes Received:
    87
    Trophy Points:
    0
    Occupation:
    Programmer
    Location:
    Kolkata, India
    Home Page:
    http://blog.pradeep.net.in
    Please read the documentation properly, it says that WebRequestMethods.File.DownloadFile doesn't have a 2nd parameter!
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice