我目前有ftp可以正常工作,但是现在我想要ssl认证并启用ssl
当前代码:
public async Task FtpFileAsync(string path, string newName = null)
{
try
{
using (var wc = new WebClient())
{
wc.Credentials = new NetworkCredential(config.Username, config.Password);
wc.Encoding = Encoding.UTF8;
var address = String.IsNullOrEmpty(newName) ? config.Url + Path.GetFileName(path) : config.Url + newName;
var response = await wc.UploadStringTaskAsync(address,WebRequestMethods.Ftp.UploadFile,GetFileContent(path));
}
}
catch (Exception e)
{
System.Diagnostics.Debug.WriteLine(e);
throw;
}
}