I am using the SharePoint Client Object Model to get information from a SharePoint 2010 document library to be able to delete old htm-files located there. The problem is that these htm-files have hidden "_files"-folders associated to them. I am not able to find these folders using the SharePoint Client Object Model, they just don't show up. I can see them in Windows Explorer using WebDav, but not in SharePoint. They don't get deleted if I just delete the .htm-file.
using (ClientContext context = new ClientContext(webUrl))
{
Web web = context.Web;
context.Credentials = System.Net.CredentialCache.DefaultCredentials;
context.Load(web);
context.ExecuteQuery();
Folder fldr = web.GetFolderByServerRelativeUrl(serverRelativeFolderUrl);
context.Load(fldr);
context.Load(fldr.Folders);
context.ExecuteQuery();
foreach (Microsoft.SharePoint.Client.Folder folder in fldr.Folders)
{ // no hidden folders found here, only usual folders
Console.WriteLine(folder.Name);
}
}