//Create some test files
Dictionary<string, string> files = new Dictionary<string, string>();
for (int i = 0; i < 10; i++)
{
string filePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "uploadfile" + i + ".txt");
File.WriteAllText(filePath, "This is a test");
files.Add(filePath, Path.GetFileName(filePath));
}
FTP ftp = new FTP(); //Trial Mode
//FTP ftp = new FTP("place user name here", "place license key here");
// set the name of the FTP server( its URL )
ftp.HostAddress = "ftp.fsz.bme.hu"; // a hungarian university. change this to your ftp server
ftp.UserName = "anonymus"; // replace with your user name
ftp.Password = "user@mail.com"; // replace with your password
ftp.Connect();
ftp.CurrentDirectory = "/";
await ftp.UploadFilesInParallelAsync(files);
//Delete local files
foreach (var file in files)
{
File.Delete(file.Key);
}
await ftp.DownloadFilesInParallelAsync(files);
ftp.Disconnect();