sharepoint获取文件的ICON
2012-11-14 11:40
204 查看
代码片段如下:
方法一(文档库):
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 + "'/>";
}
方法一(文档库):
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 + "'/>";
}
相关文章推荐
- sharepoint 2010 获取文件小图标地址get document icon url
- Sharepoint 列表中 附件文件获取
- 纯java从apk文件里获取包名、版本号、icon
- 获取指定文件的图标,返回Icon
- How to get the file's icon using C++ - 用C++如何获取文件的图标
- sharepoint 2007 获取启用特定数量历史版本文件的信息(站点/最后更新时间/author/修改者/版本数/大小)
- C# 获取系统Icon、获取文件相关的Icon
- SharePoint 2010 文档库添加文件icon
- SharePoint 2013 开发——获取用户配置文件属性内容(User Profile)
- 使用 IconHandler 2.0 获取 文件图标
- WPF 获取指定文件的Icon
- Windows CE如何根据文件名获取其对应文件图标icon
- 递归获取SharePoint文档库文件夹内的所有文件
- 转载:使用 IconHandler 2.0 获取 文件图标
- 用lists.asmx web service 获取文件夹中的文件数量 - SharePoint 2010
- [sharepoint]rest api文档库文件上传,下载,拷贝,剪切,删除文件,创建文件夹,修改文件夹属性,删除文件夹,获取文档列表
- SharePoint 2010 文档库添加文件icon
- 获取文件的ICON
- Sharepoint 列表中 附件文件获取
- [sharepoint]rest api文档库文件上传,下载,拷贝,剪切,删除文件,创建文件夹,修改文件夹属性,删除文件夹,获取文档列表