473,491 Members | 2,636 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

WebClient.DownloadFile() plus cookie?

Hi,
How do I add a required cookie to my WebClient.DownloadFile() request?
Chip
Sep 14 '06 #1
3 2267
I've not done it with downloadfile, but I expect you would use the
cookiecontainer
http://msdn2.microsoft.com/en-us/lib...container.aspx

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"Chip" <ch**@intradata.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
Hi,
How do I add a required cookie to my WebClient.DownloadFile() request?
Chip

Sep 14 '06 #2
OK, I guess that answers my question indirectly. I will need to use
HttpWebRequest instead of WebClient.
Thanks,
Chip

"John Timney (MVP)" <x_****@timney.eclipse.co.ukwrote in message
news:at********************@eclipse.net.uk...
I've not done it with downloadfile, but I expect you would use the
cookiecontainer
http://msdn2.microsoft.com/en-us/lib...container.aspx

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
"Chip" <ch**@intradata.comwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>Hi,
How do I add a required cookie to my WebClient.DownloadFile() request?
Chip


Sep 14 '06 #3
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
ne********@joergjooss.de
Sep 16 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4214
by: James Write | last post by:
Hi, I am using the webclient.downloadfile() method to download a file from a remote web server to the local harddrive. public CopyFile(string sSrcPath, string sDestPath) { WebClient oClient...
1
4774
by: Cheri Elkin | last post by:
I recieve the following error when attempting to download a file from our web server to be placed on our hard drive. Any clues as to why I would get this error? By the way, the directory already...
8
8991
by: DEWright_CA | last post by:
Why does WebClient.DownloadFile loose my completed path? Ok, I have a function in my app then when my button is clicked it checks to see if the files come from a local drive or a http address....
1
2894
by: peter.rietmann | last post by:
I have been suddenly having a performance problem downloading images from one server (productive) to another (productive) using the following code .. WebClient webClient = new WebClient(); try...
1
4954
by: A.M-SG | last post by:
Hi, I have an aspx page at the web server that provides PDF documents for smart client applications. Here is the code in aspx page that defines content type: Response.ContentType =...
2
3224
by: Lila Godel | last post by:
I am having a problem with the download of web pages via the WebClient.DownloadFile function in the specialized VB.Net 2003 I.E. plug-in I am designing to speed up the work on my latest project. ...
1
4729
by: David Satz | last post by:
Hello--I just upgraded to Visual Studio .NET 2005 and suddenly, all my .NET 1.1 applications that accessed Web sites have broken. For example, this code: WebClient wc = new WebClient();...
1
6273
by: vin.dor | last post by:
Dear All, I am using WebClient in my Visual Studio .Net 2003 project to download an image from the Internet. The following is my function: C# Code: public static bool downloadFile(string...
8
9495
by: =?Utf-8?B?UnVpIE9saXZlaXJh?= | last post by:
WebClient.DownloadFile I am using the WebClient.DownloadFile function to download a file from server to a local client. When I execute the below code, file is created in server and not in...
0
6974
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4573
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1389
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.