0

I have an application that can perform FTP/SFTP connections but I'm having issues with something, all this time I've been tested it using a remote directory that I knew, but for now I want to get connected to a server to the root directory if I don't know the remote directory.

What it does is:

if (RemoteDirectoryPath != "Home")
    RemoteDirectory  = MySession.ListDirectory(RemoteDirectoryPath);
else
    RemoteDirectory = MySession.ListDirectory("/");

As you can see in my code above, if the directory is different from Home it will list directory "/", today I was receiving an error that "/" does not exist, even when I did an ftp connection with cmd and then pwd, it was telling me that remote directory was "/"

How can I list directory without use RemoteDirectory = MySession.ListDirectory("/"); and have someting like RemoteDirectory = MySession.ListDirectory(Root.Directory);

Do you have any idea?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992
Javier Salas
  • 1,064
  • 5
  • 15
  • 38

1 Answers1

1

I figured out how to get the path!

RemoteDirectory = MySession.ListDirectory(MySession.HomePath);

Javier Salas
  • 1,064
  • 5
  • 15
  • 38