Get path root for a directory in CSharp
Description
The following code shows how to get path root for a directory.
Example
using System;/*from w w w. ja v a 2 s. c o m*/
using System.Diagnostics;
using System.IO;
class TestPathApp {
static void Main(string[] args) {
Console.WriteLine(Path.GetPathRoot(Directory.GetCurrentDirectory()));
}
}
The code above generates the following result.