【问题标题】:How to retrieve attachement file From Custom list sharepoint2010?如何从自定义列表 sharepoint 2010 中检索附件文件?
【发布时间】:2011-09-08 17:01:54
【问题描述】:

我已经创建了自定义列表..并通过 Visual webpart 将表单数据提交到列表中。但是当我附加到列表的附件时我有疑问。 现在是从自定义列表中检索数据的时候了,但是我如何从列表中检索附件文件并易于最终用户下载??? 请有人保护我

【问题讨论】:

    标签: visual-studio-2010 sharepoint sharepoint-2010 custom-lists


    【解决方案1】:
    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
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-12-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-03-14
      • 2011-05-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多