This documentation is archived and is not being maintained.

SPFolderCollection.Delete Method

Windows SharePoint Services 3

Deletes the folder that is located at the specified URL from the collection.

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

public void Delete(
	string strUrl
)

Parameters

strUrl
Type: System.String
A string that specifies the URL.

This code example deletes a folder from the specified subsite.

SPSite oSiteCollection = SPContext.Current.Site;

SPFolderCollection collFolders = 
    oSiteCollection.AllWebs["Site_Name"].Folders;

collFolders.Delete("Folder_Name");
Show: