SPList.Folders property

Gets the collection of folder items for the list.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPListItemCollection Folders { get; }

Property value

Type: Microsoft.SharePoint.SPListItemCollection
A collection of SPListItem objects that represent the folder items. If the list has an external data source, the property returns a null reference (Nothing in Visual Basic).