Windows Phone Developers

Sunday, May 6, 2012

Check if Path is Absolute or Relative Path using C# (.NET)


IsPathRooted method of Path class returns a value indicating whether the specified path string contains absolute or relative path information.

if (Path.IsPathRooted(@"c:\temp\") == true)

{

Console.WriteLine("Path is absolute");

}

else

{

Console.WriteLine("Path is relative");

}

How to find absolute path using C# (.NET), How to find relative path using C# (.NET), C# (.NET) Path Class, C# (.NET) IsPathRooted method
Digg Technorati Delicious StumbleUpon Reddit BlinkList Furl Mixx Facebook Google Bookmark Yahoo
ma.gnolia squidoo newsvine live netscape tailrank mister-wong blogmarks slashdot spurl StumbleUpon

1 comment:

  1. IsPathRooted returns a boolean value, why would you teach such ugly syntax and write "== true"?

    ReplyDelete

kbAlertz.com :: Visual Studio 2005

kbAlertz.com :: Visual Studio 2008

kbAlertz.com :: Visual Basic 2005