4
SPFileCollection foler = pdflibrary.RootFolder.Files;

Above code line will only give files outside folder. How can get all files inside and outside folder into SPFileCollection. What is the easiest way.

0

Use the following code snippet:

var query = new SPQuery();
query.Folder = pdflibrary.RootFolder;                        
query.ViewAttributes = "Scope=\"Recursive\""; 
var listItems = list.GetItems(query);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.