Is there a way to extract all the attached files in a SharePoint lis开发者_StackOverflow中文版t?
You can loop through each list item, and get each attachment.
List<SPAttachment> attachments = new List<SPAttachment>();
SPList list = SPContext.Current.Web.Lists["My List"];
foreach (SPListItem item in list.Items)
{
attachments.AddRange(item.Attachments.Cast<SPAttachment>());
}
精彩评论