public static void DeleteRemoteFile(string host, string file, string username, string password) { using (var sftp = new SftpClient(host, username, password)) { sftp.Connect(); sftp.Delete(file); sftp.Disconnect(); } }