zoukankan      html  css  js  c++  java
  • sharepoint获取文件的ICON

    代码片段如下:

     方法一(文档库):

    string strProgId = "SharePoint.OpenDocuments";
    string icon = SPUtility.MapToIcon(listItem.Web, listItem.File.Name, strProgId, IconSize.Size16);
    string iconUrl = string.Format("{0}/_layouts/images/{1}", listItem.Web.ServerRelativeUrl, icon);

    方法二(列表附件):

     string strs = "";

     SPAttachmentCollection attach = item.Attachments;
      for (int i = 0; i < attach.Count; i++)
            {
             string url = attach.UrlPrefix + attach[i];
                    SPFile file = web.GetFile(url);
                    string iconUrl = file.IconUrl;
                    strs = "<img src='/_layouts/images/" + iconUrl + "'/>";
            }
  • 相关阅读:
    MongoDB pymongo模块 删除数据
    MongoDB pymongo模块 查询
    MongoDB pymongo模块 插入数据
    MongoDB pymongo模块 更新数据
    pymongo模块 目录
    POJ 1579
    POJ 1631
    POJ 1573
    POJ 1607
    POJ 1552
  • 原文地址:https://www.cnblogs.com/ricky_li/p/2769634.html
Copyright © 2011-2022 走看看