views:

148

answers:

2

I am using the ConfigurationManager.AppSetting["blah"].ToString() method to get the path to the folder that contains the files I'm needing. But I'm throwing an UnsupportedFormatException on the path when it tries to use Directory.GetFiles(path).

The returning value has the escape characters included and I'm not sure how to keep it from returning the extra characters. This is what the path looks like after it is returned:

\\\\\\\\C:\\\\folder1\\\\folder2

A: 

I needed to remove the first four "\" to give it a correct path.

Josh H.
A: 

you have extra back-slash \ at the beginning of your path.

try putting "C:\folder1\folder2" instead of "\\C:\folder1\folder2" in your config file, and it will work.

najmeddine