I just came across what seems like a weird design choice:
System.IO.Path.GetDirectoryName(@"C:\folder\file.ext")
returns "C:\folder"
but
System.IO.Path.GetDirectoryName(@"C:\")
returns null.
I could understand it better if the first example returned "folder".
Any ideas why this is the case? And what do you do when you just want to get the folder path?