Are there any C# open-source components that allow me to delete files via SFTP?
A:
Not open source, but you could try edtFTPnet/PRO, which supports all SFTP operations including deleting of files.
As jasonh says, granados does SSH, not SFTP.
Bruce Blackshaw
2009-07-24 03:10:48
A:
You can use OpenSSH and issue sftp batch commands. All you have to do on the c# side is launch the sftp process with the correct command line.
omellet
2009-07-24 18:22:26
A:
Tamir Gal's Sharp SSH is quite popular open source implementation of SFTP for .NET. Give it a try.
If you preffer fully supported commercial component can try our Rebex SFTP. Following code ilustrates the concept:
using Rebex.Net;
// create client and connect
Sftp client = new Sftp();
client.Connect(hostname);
client.Login(username, password);
// delete the file
client.DeleteFile("/path/to/the/file");
// disconnect
client.Disconnect();
Martin Vobr
2009-10-27 13:10:19
Martin, please disclose your affiliation in each post where you mention your own products. I know you're not trying anything shady, this is just the policy that we're asking everyone to adhere to. Please see the [FAQ](http://stackoverflow.com/faq) for the official policy statement. Thanks.
Bill the Lizard
2010-10-08 17:09:01
Sure, no problem. I've added a magical 'our' word to this post (and to other posts too).
Martin Vobr
2010-10-08 17:45:06