在picture library中取某一图片的大图、小图

public static string GetPicThumbnail(SPFile file, string type)
{
    string thumbnail = "";

    string folderUrl = file.ParentFolder.ServerRelativeUrl;
    string fileName = file.Name;
    int expIndex = fileName.LastIndexOf('.');
    string subName = fileName.Substring(0, expIndex) + "_" + fileName.Substring(expIndex + 1) + ".jpg";

    if (type == "small")
    {
        thumbnail = folderUrl + "/_t/" + subName;//这是拿小图的;
    }
    else if (type == "big")
    {
        thumbnail = folderUrl + "/_w/" + subName;//这是拿大图的;
    }

    return thumbnail;
}

上一篇:SNIFFER问题集锦


下一篇:VS 之 InstallShield Limited Edition for Visual Studio 2015 图文教程