![ContractedBlock.gif](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![ExpandedBlockStart.gif](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
public static string[] GetUserAudiencesNamesArray(SPWeb spWeb)
{
ServerContext context = ServerContext.Current;
AudienceManager ma = new AudienceManager(context);
AudienceManager manaer = new AudienceManager(context);
ArrayList arrList = manaer.GetUserAudienceIDs(HttpContext.Current.User.Identity.Name, true, spWeb);
if (arrList == null) return new string[] { };
string[] names = new string[arrList.Count];
for (int i = 0; i < arrList.Count; i++)
{
names[i] = ((AudienceNameID)arrList[i]).AudienceName;
}
return names;
}