C
Carl Johansson
How come the DirectoryNotFoundException exception isn't thrown by the
following method?
private static void ShowSomeDirectoryInfo(string path)
{
// For some reason, exceptions are not thrown when the directory or
drive doesn't exist!?
DirectoryInfo dir = new DirectoryInfo(path);
Console.WriteLine("CreationTime: {0}", dir.CreationTime);
Console.WriteLine("Attributes: {0}", dir.Attributes);
}
OUTPUT:
Creation: 1601-01-01 01:00:00
Attributes: -1
Regards Carl Johansson
following method?
private static void ShowSomeDirectoryInfo(string path)
{
// For some reason, exceptions are not thrown when the directory or
drive doesn't exist!?
DirectoryInfo dir = new DirectoryInfo(path);
Console.WriteLine("CreationTime: {0}", dir.CreationTime);
Console.WriteLine("Attributes: {0}", dir.Attributes);
}
OUTPUT:
Creation: 1601-01-01 01:00:00
Attributes: -1
Regards Carl Johansson