Steps
  1. Open Visual Studio in your system
  2. Select Console Applciation template and give as name "GetallList"
  3. Add a Microsoft.Cleint Assembly refrence file in right side refrence tab in visual studio.
  4. Replace Program.cs with the source code below.
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Microsoft.SharePoint.Client;
  7. namespace GetallList
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. // ClientContext - Get the context for the SharePoint Site
  14. ClientContext clientContext = new ClientContext("http://gauti.sharepoint.com/sites/SP");
  15. // Get the SharePoint web
  16. Web web = clientContext.Web;
  17. // Get the SharePoint list collection for the web
  18. ListCollection listColl = web.Lists;
  19. // Retrieve the list collection properties
  20. clientContext.Load(listColl);
  21. // Execute the query to the server.
  22. clientContext.ExecuteQuery();
  23. // Loop through all the list
  24. foreach(List list in listColl)
  25. {
  26. // Display the list title and ID
  27. Console.WriteLine("List Name: " + list.Title + "; ID: " + list.Id);
  28. }
  29. Console.ReadLine();
  30. }
  31. }
  32. }
Output

Hit F5 and Check the Output. Hope you have enjoyed this.!!! :-)