分类: IT业界
2013-04-08 19:44:19
site = new SPSite("http://sharepoint-dev");
SPWeb web = site.OpenWeb("Documents");
string StrFileName = SPUtility.ConcatUrls
(
"http://sharepoint-dev:8002/Documents",
"http://sharepoint-dev:8002/Documents/DocLib/基本制度/交换机E.docx"
);
string docsicon = SPUtility.ConcatUrls("/_layouts/images/",SPUtility.MapToIcon(web, StrFileName, "", IconSize.Size16));
string IconUrl = docsicon;
输出的是"/_layouts/images/icdocx.png"
原文参考自web开发网: