You can access WebSite Properties through SharePoint Client Object Model.
Microsoft.SharePoint.Client should be use.
If you want to access only specific properties from WebSite, it can be achieved using LINQ.
Code:
Code:
ClientContext clientContext = new ClientContext("Site URL");
NetworkCredential Cred = new NetworkCredential("UserName", "Password", "Domain");
clientContext.Credentials
= Cred;
Web web = clientContext.Web;
clientContext.Load(web);
clientContext.ExecuteQuery();
Console.WriteLine("Title:" + web.Title);
Console.WriteLine("Description:" + web.Description);
Console.WriteLine("Created:" + web.Created);
onsole.ReadLine();
If you want to access only specific properties from WebSite, it can be achieved using LINQ.
Code:
ClientContext clientContext = new ClientContext("Site URL");
NetworkCredential Cred = new NetworkCredential("UserName", "Password", "Domain");
clientContext.Credentials = Cred;
Web web = clientContext.Web;
clientContext.Load(web,
a => web.Title,
a =>
web.Description,
a => web.Created);clientContext.ExecuteQuery();
Console.WriteLine("Title:" + web.Title);
Console.WriteLine("Description:" + web.Description);
Console.WriteLine("Created:" + web.Created);
onsole.ReadLine();
Great insights! This post clearly explains how to access a website through the SharePoint Client Object Model. It’s a must-read for developers working with Microsoft Technologies , helping them streamline SharePoint integration and enhance productivity with practical implementation steps.
ReplyDelete