SPFolder / SPList: Deleting versus Recycling
The following code shows how to remove all documents from a folder:
int iCount = spFolder.Files.Count;
for (int i = 0; i < iCount; i++)
{
spFolder.Files[0].Delete();
}
Deleting documents with this code will delete permanently without using the recycle bin. To move the document to the recycle bin use the following code:
spFolder.Files[0].Recycle();
The SPItem class has a Recycle method as well as a Delete method and can be used in a similar way.