WebClient.DownloadFile() plus cookie?

Discussion in 'ASP .Net' started by Chip, Sep 14, 2006.

  1. Chip

    Chip Guest

    Hi,
    How do I add a required cookie to my WebClient.DownloadFile() request?
    Chip
    Chip, Sep 14, 2006
    #1
    1. Advertising

  2. John Timney \(MVP\), Sep 14, 2006
    #2
    1. Advertising

  3. Chip

    Chip Guest

    OK, I guess that answers my question indirectly. I will need to use
    HttpWebRequest instead of WebClient.
    Thanks,
    Chip

    "John Timney (MVP)" <> wrote in message
    news:...
    > I've not done it with downloadfile, but I expect you would use the
    > cookiecontainer
    > http://msdn2.microsoft.com/en-us/library/system.net.httpwebrequest.cookiecontainer.aspx
    >
    > --
    > --
    > Regards
    >
    > John Timney (MVP)
    > VISIT MY WEBSITE:
    > http://www.johntimney.com
    >
    >
    > "Chip" <> wrote in message
    > news:%...
    >> Hi,
    >> How do I add a required cookie to my WebClient.DownloadFile() request?
    >> Chip
    >>

    >
    >
    Chip, Sep 14, 2006
    #3
  4. Chip

    Joerg Jooss Guest

    Thus wrote Chip,

    > OK, I guess that answers my question indirectly. I will need to use
    > HttpWebRequest instead of WebClient.


    In .NET 2.0, you have more control over WebClient. You might want to consider
    subclassing WebClient and overriding GetWebRequest(). This would allow you
    to attach your CookieContainer each time WebClient creates a HttpWebRequest.

    Cheers,
    --
    Joerg Jooss
    Joerg Jooss, Sep 16, 2006
    #4
    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. Cheri Elkin

    WebClient DownloadFile problem

    Cheri Elkin, Nov 20, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    4,832
    Jon Paugh
    Nov 20, 2003
  2. Chris
    Replies:
    6
    Views:
    7,491
    Patrice
    Jul 13, 2004
  3. =?Utf-8?B?REVXcmlnaHRfQ0E=?=

    WebClient.DownloadFile only see's Local????

    =?Utf-8?B?REVXcmlnaHRfQ0E=?=, May 25, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    2,631
    Steven Cheng[MSFT]
    Jun 6, 2005
  4. Replies:
    1
    Views:
    945
    Joerg Jooss
    Oct 22, 2005
  5. A.M-SG
    Replies:
    2
    Views:
    5,410
    Kspatel
    Aug 31, 2009
Loading...

Share This Page