I am trying to get whether a directory path is valid or not using the Path
class as suggested in this answer.
However, while I expect Path.GetFullName("C:SomeDirectory")
(without any slashes) to throw an exception, it returns C:\Windows\system32\SomeDirectory
.
Also, if I write Directory.Create("C:SomeDirectory")
it tries to create the directory again under C:\Windows\system32
.
When I try to enter C:drivers
, for example, to address bar in windows explorer I get error Windows cannot find file. Check the spelling and try again.
Command line gives an error on cd C:drivers
, too.
Is this an expected behaviour?