Works fine for me in .Net 2.0.
Suggestions:
Copy and paste your code into a code editor like UltraEdit and check for non
ASCII characters.
Here's my listing:
class Program
{
static void Main(string[] args)
{
string _NewDir = "c:\\somewhere\\somewhereelse\\here\\";
try
{
Directory.CreateDirectory(_NewDir);
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
Console.ReadLine();
}
}
--
Good luck!
Shailen Sukul
Architect
(BSc MCTS, MCSD.Net MCSD MCAD)
Ashlen Consulting Service P/L
(
http://www.ashlen.net.au)
"Toolsmith" wrote:
The following code:
C# code:
Directory.CreateDirectory("D:\\somewhere\\somewher eelse\\here\\")
works, but the following does flags the error:
An unhandled exception of type 'System.NotSupportedException' occurred in
mscorlib.dll
Additional information: The given path's format is not supported.
C# code:
string _NewDir = "D:\\somewhere\\somewhereelse\\here\\";
Directory.CreateDirectory(_NewDir);
Why?