首页 > 代码库 > share point 读取 metadata

share point 读取 metadata

private static void syncMetaData()
        {
            var siteUrl = @"http://...";
            using (var site = new SPSite(siteUrl))
            {
                var session = new TaxonomySession(site);
                foreach (var termStore in session.TermStores)
                {
                    foreach (var group in termStore.Groups)
                    {
                        foreach (var termSet in group.TermSets)
                        {
                               SyncTerms(termSet.Terms);
                        }
                    }
                }
            }
        }
private static void SyncTerms(TermCollection terms)
        {
            foreach (var term in terms)
            {
                SyncTerms(term.Terms);
            }
        }