There are times when we need to fetch only the items within a specific folder. In those cases we can use the ‘Folder’ property of SPQuery class. Simply set the ‘Folder’ property to a Folder object which represents the folder instance from where we need the items.
SPList spList = spWeb.Lists.TryGetList("Documents");
SPFolder folder = spList.RootFolder.SubFolders["Document Set 1"];
SPQuery query = new SPQuery();
query.Query = "Enter your query here";
query.Folder = folder;
SPListItemCollection items = spList.GetItems(query);
Reference URL: http://spdeveloper.co.in/articles/pages/get-items-from-a-specific-folder-in-sharepoint-list.aspx