C# – How to Check Folder Exits on Sharepoint Document Library

asp.netcshared-librariessharepoint-2010

I want to check Folder exits on Sharepoint Document Library.

  • I have a Document Library called Attachments there are many Root Folders like this (CMR_2000,CMR_2001)

  • as a example i want to check is CMR_2000 folder already exits on sharepoint document library ?

How can i do this ??

Best Answer

You can do it as follows

if (SPWeb.GetFolder(folderAbsoluteUrl).Exists)
{
    //Folder Exisits
}