Share via


用代码添加Audience

发现在SPS2003的SDK中没有关于Audience的具体代码,所以把以前的一段代码贴在这里:

AudienceManager AudMgr = new AudienceManager(PortalApplication.GetContext());

ArrayList AudienceRule;

AudienceCollection oCol = AudMgr.Audiences;

Audience oA = oCol.Create("testorg","test");

AudienceRule = new ArrayList();

AudienceRule.Add(new AudienceRuleComponent("Everyone","Reports Under",@"domain\user"));

oA.AudienceRules = AudienceRule;

oA.Commit();