private void Iconizator()
{
string testpPath = @"D:\test\Login.eps";
string adres = "ftps.shutterstock.com";
string login = "test@gmail.com";
string pass = "pass";
UploadFile(adres, testpPath, login, pass);
}
private static FtpClient CreateFtpClient(string host, string login, string pass)
{
return new FtpClient(host, new System.Net.NetworkCredential { UserName = login, Password = pass });
}
private async void UploadFile(string host, string fileToUpload, string login, string pass)
{
using (FtpClient ftp = CreateFtpClient(host, login, pass))
{
ftp.EncryptionMode = FtpEncryptionMode.Auto;
ftp.ValidateAnyCertificate = true;
ftp.Connect(); // Здесь выдает ошибку "System.Net.Sockets.SocketException: "Требуемый адрес для своего контекста неверен""
await ftp.UploadFileAsync(fileToUpload, System.IO.Path.GetFileName(fileToUpload));
MessageBox.Show($"FILE UPLOADED {fileToUpload}");
}
}