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

share point 读取 List数据

时间:2014-05-08 20:36:52      阅读:454      评论:0      收藏:0      [点我收藏+]

标签:style   blog   class   code   java   color   

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数据

标签:style   blog   class   code   java   color   

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

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