zoukankan      html  css  js  c++  java
  • SharePoint 2010 如何取得ListItem的Attachements

    最近一个项目用到读取SharePoint ListItemattachments ,在网上找了很多资料终于知道了如何取得一个itemattachments,记录之,已被后用。

    string sourceInitialName =  sourceList.DefaultViewUrl.Substring(7,index-7);//取得列表名称
    
    SPListItem sourceItem = sourceList.GetItemById(SourceItemID);//取得Item
    
    SPFolder sourceListAttFolder = sourceItem.Web.Folders["Lists"].SubFolders[sourceInitialName].SubFolders["Attachments"].SubFolders[sourceItem.ID.ToString()];
    //取得item的附件所在文件夹集合 
    
    //循环处理逻辑
    foreach (SPFile AttFile in sourceListAttFolder.Files)
    {
        byte[] binFile = AttFile.OpenBinary();
        string copiedFileName = AttFile.Name;
          ....
    }
    

  • 相关阅读:
    vnode之update 还是没太懂
    vnodec创建之标签
    1054 求平均值
    1053 住房空置率
    1052 卖个萌
    1051 复数乘法
    1050 螺旋矩阵
    1049 数列的片段和
    1048 数字加密
    1047 编程团体赛
  • 原文地址:https://www.cnblogs.com/dexter2003/p/2139148.html
Copyright © 2011-2022 走看看