- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Microsoft.SharePoint.Client;
- namespace GetSharePointContentTypes
- {
- class Program
- {
- static void Main(string[] args)
- {
- string siteURL = "http://siteURL.com/";
- ClientContext clientContext = new ClientContext(siteURL);
- ContentTypeCollection contentTypeColl = clientContext.Web.ContentTypes;
- clientContext.Load(contentTypeColl);
- clientContext.ExecuteQuery();
- foreach (ContentType ct in contentTypeColl)
- {
- Console.WriteLine(ct.Name);
- }
- Console.ReadKey();
- }
- }
- }
This code is for to Get SharePoint Content Type using CSOM C#.
