我一直试图在我的 TextBox 中获得多个结果,但我无法做到正确。有人可以给我看一个将这个数组显示到文本框中的例子吗?
public ArrayList GetUserGroups(string sUserName)
{
textBox1.Multiline = true;
ArrayList myItems = new ArrayList();
UserPrincipal oUserPrincipal = GetUser(sUserName);
PrincipalSearchResult<Principal> oPrincipalSearchResult = oUserPrincipal.GetGroups();
textBox1.Multiline = true;
foreach (Principal oResult in oPrincipalSearchResult)
{
myItems.Add(oResult.Name);
textBox1.Text = oResult.Name.ToString();
}
return myItems;
}