c# get directory part of path

C#
public static string GetDirectoryName (string path);
Source

Also in C#: