The following example reads specific properties of a website.
try
{
string siteUrl = "http://server/SiteCol";
//The constructor ClientContext requires a url
using(ClientContext clientContext = new ClientContext(siteUrl))
{
Web website = clientContext.Web;
//retrieves the title and site Created
clientContext.Load(
website,
ws => ws.Title,
ws => ws.Created);
clientContext.ExecuteQuery();
Console.WriteLine("Title: {0} Created: {1}", website.Title, website.Created);
}
}
catch (Exception exe)
{
Console.WriteLine(exe.Message);
}
Console.Read();
(Visited 213 times, 1 visits today)
