I would prefer to give you something to think about than some sample code that gets your job done (giving a man a fish and all that).
First - You say you're using SessionAwareCoreService2010Client
hopefully because you're on Tridion 2011 GA instead of SP1. Otherwise I would certainly recommend using the pre-compiled client and the SessionAwareCoreServiceClient
.
Now you say you want all folders. Do you want ALL folders in a publication in one call, or do you want to "walk" the hierarchy recursively?
All Organizational Items support a GetList call. With the CoreService this is achieved by using a client.GetListXml(subjectId, subjectRelatedFilter)
call. If you only want folders, then you would start by creating a OrganizationalItemItemsFilterData
object, and specifying that you want only objects of type Folder
in the filter.ItemTypes
array (along the lines of filter.ItemTypes = new[]{ItemType.Folder};
Now you can implement a method that would recursively call itself for every object returned by the client.GetList call and read whatever properties you need from the objects.
If you really need sample code, then I would recommend googling for it.