I am working on a Windows Application that serves as a CMS for a website. In the program I have a gallery which is using FtpClient from System.Net.FtpClient.
I'm able to establish a connection and calling the GetListing method (without a path as argument) without error. This returns the root folder - fine. The FullName of the single item in the return value (FtpListItem-array) is "/<#UserName#>/<#Root#>/"
But when I'm trying to call the GetListing with a path it returns the error "<#Path#>: The filename, directory name, or volume label syntax is incorrect".
I have tried with the following paths:
"ftp://<#FtpServer#>/<#Root#>/<#Path#>"
"<#UserName#>/<#Root#>/<#Path#>"
"<#Root#>/<#Path#>"
I'm sorry for asking this question before I checked my code thoroughly. It turned out that the "<#Root#>/<#Path#>" was the correct path, but some how I had put a "/" before the path - which caused the error.