15 November, 2011
0 Comments
1 category
If you want to determine if a string contains a relative or absolute folder / file path, you can use the System.IO.Path.IsPathRooted function:
Console.WriteLine(System.IO.Path.IsPathRooted(@"..\Test.cs")); // Result: False Console.WriteLine(System.IO.Path.IsPathRooted(@"C:\Test.cs")); // Result: True
Tags: C#
Category: Uncategorized