For searching files in a directory, I am using this snippet of code :
string targetToCopy = ConfigurationManager.AppSettings["drive"] + element.Element("categorie").Value.ToString().Replace(" / ", @"\");
DirectoryInfo directoryToCopy = new DirectoryInfo(targetToCopy);
I create the path with this string targetToCopy, I parse the string in DirectoryInfo for using the directoryToCopy.GetFiles() method.
This method searches files with path, and when I use this in my loop, I get an error:
System.NotSupportedException : 'The format of the given path is not supported.'
I don't know what this error means, but if you know how to solve the problem.
Thank you and good luck :)
I determined the problem by outputting my path to a log file, and finding it not formatting correctly. Correct for me was quite simply: