C Chip Sep 14, 2006 #1 Hi, How do I add a required cookie to my WebClient.DownloadFile() request? Chip
J John Timney \(MVP\) Sep 14, 2006 #2 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
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
C Chip Sep 14, 2006 #3 OK, I guess that answers my question indirectly. I will need to use HttpWebRequest instead of WebClient. Thanks, Chip
OK, I guess that answers my question indirectly. I will need to use HttpWebRequest instead of WebClient. Thanks, Chip
J Joerg Jooss Sep 16, 2006 #4 Thus wrote Chip, OK, I guess that answers my question indirectly. I will need to use HttpWebRequest instead of WebClient. Click to expand... 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,
Thus wrote Chip, OK, I guess that answers my question indirectly. I will need to use HttpWebRequest instead of WebClient. Click to expand... 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,