Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我已经创建了自定义列表..并通过 Visual webpart 将表单数据提交到列表中。但是当我附加到列表的附件时我有疑问。现在是从自定义列表中检索数据的时候了,但是我如何从列表中检索附件文件并易于最终用户下载???请有人保护我
SPFolder folder = web.Folders["Lists"].SubFolders[list.Title].SubFolders["Attachments"].SubFolders[listitem.ID.ToString()];
然后你可以这样做:
foreach (SPFile file in folder.Files) { // Do what you want to do with the file }