Sharepoint SPSiteDataQuery多列表查询:查询整个网站7天内的所有内容更新

需求: 查询整个网站七天内所有的内容更新

SPSiteDataQuery query1 = new SPSiteDataQuery();
            query1.ViewFields = "<OrderBy><FieldRef Name=\"Modified\" Ascending=\"False\" /></OrderBy><Where><Gt><FieldRef Name=‘Modified‘ /><Value Type=‘DateTime‘><Today OffsetDays=‘-7‘ /></Value></Gt></Where>";
            query1.RowLimit = 100;
            query1.Webs = "<Webs Scope=\"Recursive\" />";
            query1.Lists = "<Lists BaseType=\"0\" />";
            using (SPSite site = new SPSite("http://dev-sp"))
            {
                DataTable dt = site.RootWeb.GetSiteData(query1);
                foreach (DataRow row in dt.Rows)
                {
                    foreach (DataColumn column in dt.Columns)
                    {
                        Console.WriteLine("dt[" + column.ColumnName + "]: " + row[column]);
                    }
                }

            }


 



Sharepoint SPSiteDataQuery多列表查询:查询整个网站7天内的所有内容更新

上一篇:HNU JAVA 吸血鬼数字


下一篇:【Go反射】读取对象