473,322 Members | 1,496 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Error Handling while downloading from FTP site

2
Hello

Problem: I need to download files from an FTP site while moving very fast.
I expect connection problems during downloads. If a file is half downloaded and there is a connection glitch, then the file needs to be downloaded fully once again. Likewise, different actions have to be taken based on the error.

How to handle error cases using WebClient.DownloadFile? Or are there any other better APIs?

--- sample code ---
WebClient fileGetter = new WebClient();
fileGetter.Credentials = new NetworkCredential(userName, passWord);

//download files
fileGetter.DownloadFile(source, destPath);
----
Nov 20 '08 #1
1 1327
Plater
7,872 Expert 4TB
Use try/catch blocks
Nov 20 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
0
by: Erland Sommarskog | last post by:
I've added two more articles to my web site. Both are about error handling in SQL Server. I also cover ADO to some extent. The articles are "Error Handling in SQL Server - a Background",...
1
by: Bill S. | last post by:
Hi, I a stored procedure that inserts a record into a table as below. The insert works OK, but if the insert violates a unique indewx constraint on one of the columns, the proc terminates...
0
by: Kamal Dhingra | last post by:
Hi Guys, I am developing an asp.net application .In error handling , I have 2 web.congif files ,one is in Web(which is the virtual directory) ,other i have created in a folder in Web/Admin. The...
19
by: MLH | last post by:
I call the following Sub and Function in frmLaunch's OnOpen event code. I keep getting Property Not Found error for the AllowBypassKey setting. Failure point is line #30 in the Function (not the...
14
by: Al Smith | last post by:
I need help in implementing proper error handling. I am trying to upload a file based on the sample code below. The code works well except if the file selected is too big. I do know about the...
1
by: Metal Dave | last post by:
I do not understand the error handling of SQL Server here. Any error in bulk insert seems to halt the current T-SQL statement entirely, rendering it impossible to log an error. The first statement...
4
by: DavideR | last post by:
I have converted a large vb6 program with an add-in that for every routine gimme the error handling: the add-in adds one line on the head of the routine "if myerrhandle then ON ERROR GOTO...
2
by: ajcoon | last post by:
Hello, I am using XSV and occasionally I get an error that looks like this: File "/usr/lib/python2.3/site-packages/XSV/driver.py", line 125, in runit f=SSchema(ren,not useDTD) File...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.