I know it was asked in topic 1160, but no outcome came of it. I'm having the same issue:
string l_strFileName = null;
l_strFileName = myFile.Name;
ftpConnection1.DownloadFile(@"c:\temp\" + l_strFileName, l_strFileName);
When it gets to that third line, it fails with an exception message, "The process cannot access the file \"c:\\temp\\myFile.zip\" because it is being used by another process." Looking in the directory, the file is there, but only 4k of it.
The stacktrace is here:
" at System.IO.__Error.WinIOError(Int32 errorCode, String str)\r\n at System.IO.FileInfo.Delete()\r\n at EnterpriseDT.Net.Ftp.FTPClient.GetASCII(String localPath, String remoteFile)\r\n at EnterpriseDT.Net.Ftp.FTPClient.Get(String localPath, String remoteFile)\r\n at EnterpriseDT.Net.Ftp.FTPConnection.DownloadFile(String localPath, String remoteFile)\r\n at Scratch.Form1.btnLoad_Click(Object sender, EventArgs e) in e:\\visual studio projects\\scratch\\form1.cs:line 213"
Line 213 is where the third line of code I mention above is located, I have a bit more logic in the app to pull out only certain files - but looking at what's being sent, it looks right.