//using Microsoft.SharePoint.Client;
//using System.Net
//GetNonhiddenLists(credentials, weburl);
//This method returns the lists from the web, which are visible to users
private static void GetNonhiddenLists(ICredentials credentials, string weburl)
{
using (ClientContext ctx = new ClientContext(weburl))
{
ctx.Credentials = credentials;
Web oweb = ctx.Web;
ListCollection lists = oweb.Lists;
var listsQuery = from lst in lists
where lst.Hidden != true
select lst;
IEnumerable<List> listcollection = ctx.LoadQuery(listsQuery);
ctx.ExecuteQuery();
Console.WriteLine("Non hidden Lists / Libraries: " + listcollection.Count().ToString());
foreach (List lst in listcollection)
{
Console.WriteLine(lst.Title);
}
}
Console.WriteLine("Press any key to exit...");
Console.Read();
}This code snippet helps to get the non hidden lists from SharePoint web using CSOM.
