/// <summary> /// 获取取子文件下所有文件 /// </summary> /// <param name="web"></param> /// <param name="folders"></param> private void EnumerateFolders(SPWeb web, SPFolderCollection folders) { foreach (SPFolder subFolder in folders)//获取文件夹中的文件 { SPFileCollection subFiles = subFolder.Files; foreach (SPFile file in subFiles) { AddItemToDocFileList(file, web, subFolder); } SPFolderCollection subFolders = subFolder.SubFolders;//获取文件夹中的子文件夹 EnumerateFolders(web, subFolders); } }
原文地址:https://www.cnblogs.com/sayshap/p/10496455.html
时间: 2024-10-29 19:08:25