首页 > 其他 > 详细

share point 读取 List数据

时间:2014-05-08 20:34:34      阅读:372      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite oSite = new SPSite(siteUrl))
                {
                    foreach (SPWeb oWeb in oSite.AllWebs)
                    {
                        foreach (SPList oList in oWeb.Lists)
                        {
                            if (oList.Title != "Organizations")
                                continue;

                            var sb = new StringBuilder();
                            sb.AppendLine(oList.Title);
                            foreach (SPListItem oItem in oList.Items)
                            {
                                if (oItem.Versions.Cast<SPListItemVersion>().FirstOrDefault(v => v.Level == SPFileLevel.Published) != null)
                                {
                                    foreach (SPField fd in oItem.Fields)
                                    {
                                        object value = oItem[fd.Id];
                                        sb.AppendFormat("[{0}]={1}\t;", fd.Title ,value ?? string.Empty);
                                    }
                                }
                                sb.AppendLine();
                            }
                            
                            Debug.Print(sb.ToString());
                            return;
                        }
                    }
                }
            });
bubuko.com,布布扣

 

share point 读取 List数据,布布扣,bubuko.com

share point 读取 List数据

原文:http://www.cnblogs.com/nanfei/p/3709310.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!