Code:
using (SPSite spSite = new SPSite(@"http://localhost"))
{
ServerContext siteContext = ServerContext.GetContext(spSite);
AudienceManager amManager = new AudienceManager(siteContext);
string strName = "Technology Department";
if (amManager.Audiences.AudienceExist(strName))
{
amManager.Audiences.Remove(strName);
}
}
0 comments:
Post a Comment