码迷,mamicode.com
首页 > 其他好文 > 详细

SharePoint 2013 代码获取图片库中的大图、小图、原图

时间:2014-09-11 23:42:32      阅读:225      评论:0      收藏:0      [点我收藏+]

标签:io   ar   sp   cti   代码   on   c   r   bs   

SharePoint 2013中,上传一张图片,除原图外,默认生成一张大图、一张小图,可以根据自己的需要将不同的图运用在不同的位置。

SPListItemCollection itemColl=GetPicLibraryItemColl();

SPWeb web = SPContext.Current.Web;
SPFile sf = spfolder.Files[0];
string folderUrl = sf.ParentFolder.Url;

string fileName = sf.Name;
int expIndex = fileName.LastIndexOf(‘.‘);
string subName = fileName.Substring(0, expIndex) + "_" + fileName.Substring(expIndex + 1) + ".jpg";
imageUrl = web.Url + "/" + folderUrl + "/_w/" + subName;       //大图地址
//imageUrl = web.Url + "/" + folderUrl + "/_t/" + subName;      //小图地址

//imageUrl = web.Url + "/" + sf.Url;                  //原图地址

SharePoint 2013 代码获取图片库中的大图、小图、原图

标签:io   ar   sp   cti   代码   on   c   r   bs   

原文地址:http://www.cnblogs.com/TroubleShooting/p/3967374.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!