I think your problem is that you are not specifying the local file fully. You should specify the full local file-name, not just the directory. Try something like this:
Private Sub btnMvClan_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnMvClan.Click
Try
FtpConnection1.Timeout = 3000
FtpConnection1.ServerDirectory = "/wwwroot/admin/importfiles"
FtpConnection1.Connect()
Dim fileName As String = Path.GetFileName(lstRemoteStock.SelectedItem.ToString())
FtpConnection1.DownloadFile("c:\temp\" & fileName, lstRemoteStock.SelectedItem.ToString())
FtpConnection1.Close()
Catch ex As Exception
If FtpConnection1.IsConnected Then
FtpConnection1.Close()
End If
MessageBox.Show(Me, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
End Try
End Sub
Before you ask, I believe the next version of edtFTPnet (to be released soon), will automatically append the file-name if the localFile argument to DownloadFile specifies a directory.
- Hans (EnterpriseDT)