My company has a document library with several levels of sub folders. I'm aware this isn't ideal, meta data would be better, etc., but this is what I have to work with. I'm looking to list out the contents of this document library in an unordered list on an ASPX page. Each sublevel would be another nested UL, under a heading which would be the folder name.
Long story short - how do I A) get subfolder names in C#, and B) get the files in those subfolders?
I'm familiar with iterating through files ala
SPSite site = new SPSite("****");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["docLibrary"];
foreach (SPListItem i in list.Items)
{
formList.Text += i["Name"] + "<br />";
}
but I don't quite know where to go from here. Thanks.