Getting ftp root directory listing

Jun 11, 2010 at 11:25 PM

I'm trying to get the all directories in my root folder.

I've tried

foreach (var ftpDir in ftpConnection.GetDirectories())
                {
                    Console.WriteLine(ftpDir.FullName);
                }

foreach (var ftpDir in ftpConnection.GetDirectories("/"))
                {
                    Console.WriteLine(ftpDir.FullName);
                }

foreach (var ftpDir in ftpConnection.GetDirectories(".."))
                {
                    Console.WriteLine(ftpDir.FullName);
                }

foreach (var ftpDir in ftpConnection.GetDirectories("../"))
                {
                    Console.WriteLine(ftpDir.FullName);
                }

But I keep getting:

"Absolute path information is required."

If I specify a path it works fine.

 

How do I solve it?

Jun 12, 2010 at 1:31 PM

I solved this one. It was .FullName who threw the exception.