Ejemplo n.º 1
0
        // Phương thức download file truyền vào đối tượng client và tên tập tin muốn download
        private void DownloadFile(Ftp client, string filename, string path)
        {
            // Bỏ qua kiểm tra crossthread
            CheckForIllegalCrossThreadCalls = false;
            client.Connect(_ip, _port); // kết nối đến server FTP
            client.Login(_username, _password);

            // thực thi phương thức download(tên tập tin muốn download, vị trí lưu)
            // vị trí lưu ở đây là folder được chọn từ user.
            client.Download(filename, path + "\\" + filename); // thực thi phương thức download(tên file muốn download, vị trí lưu)


            client.Close();
        }