Search This Blog

Showing posts with label get list of all lists in sharepont site. Show all posts
Showing posts with label get list of all lists in sharepont site. Show all posts

Tuesday, June 7, 2011

Getting List of all list in a sharepoint site using client object model


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint.Client;
using Microsoft.SharePoint.Client.Utilities;

        private static void GetAllListsinCurrentWeb()
        {
            ClientContext Context = new ClientContext(“http://sharepointsite/“);
            Web Web= Context.Web;
            Context.Load(oWeb);
            Context.ExecuteQuery();
            ListCollection currentListCollection= oWeb.Lists;
            Context.Load(currentListCollection);
            Context.ExecuteQuery();
            foreach (List List in currentListCollection)
            {
                Console.WriteLine(List.Title);
            }
            Console.ReadLine();

        }

Featured Posts

Discover powerful tools for digital investigations, IP intelligence, threat hunting, exposed services, data breach research and satellite imagery.

14 Powerful OSINT Tools for Cybersecurity | BytesXplorer </> Bytes Xplorer TECHNOLOGY • ...