Search code examples
c#sharpssh

Cannot change sftp remote directory using SharpSSH in C#?


I've tried every combination of a path string that I can think of but still I get back "The requested file does not exist"? I've searched the internet for the past few hours and I cannot find an example. Can anyone point out what I'm doing wrong. I've tried the following already.

Using the ls command from the root. I get a list of the directories and files available. So say it returned the following list.

Outbound Inbound

I've so far tried.

cd ./Inbound/
cd /Inbound/
cd Inbound
cd //Inbound//
cd //Inbound
cd Inbound/
cd ../Inbound/
cd \Inbound\
cd \\Inbound\\
cd ..\\Inbound\\


Solution

  • I used to do some maintenance work on the SharpSSH library (bitbucket.org/mattgwagner/SharpSSH) but I can honestly say I'd recommend you check out sshnet.codeplex.com for a properly designed and better functioning library. The original SharpSSH was a DIRECT port of a Java library to .NET 1.1, I believe, and suffers from the translation.