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);
            }
        }

 

posted on 2014-05-05 15:03  空明流光  阅读(154)  评论(0编辑  收藏  举报

导航