ViewFields是SPViewFieldCollection, 只能拿到interal name,要获取中文的字段名,可以事先做一个internalName到title的转换:
using System.collection;
SPSite site = new SPSite("url");
SPWeb web = site.OpenWeb();
SPList list = web.Lists[listname];
SPView listview = onelist.Views[view];
Hashtable internalToTitle = new Hashtable();
foreach(SPField field in list.Fields)
{
internalToTitle.Add(field.InternalName, field.Title);
}
输出的时候转换一下:
for(int j=0;j<listview.ViewFields)
{
output.write(internalToTitle[view.ViewFields[j]].ToString());
}
posted on 2006-10-30 10:32
曾科 阅读(340)
评论(1) 编辑 收藏 所属分类:
SharePoint Portal Server