Last active
August 22, 2019 22:55
-
-
Save jorgepsmatos/c193df91c51f88bed442c95f36d95175 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void Delete(string fileToDelete, string host, string username, string password) | |
{ | |
try | |
{ | |
using (var sftpClient = new SftpClient(host, username, password)) | |
{ | |
sftpClient.Connect(); | |
sftpClient.DeleteFile(fileToDelete); | |
sftpClient.Disconnect(); | |
} | |
} | |
catch (Exception e) | |
{ | |
Console.WriteLine(e.Message); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment