ProfileManagerBase.Search 方法
检索此其可搜索属性与指定的搜索模式匹配的配置文件类型的ProfileBase对象的一个数组。
重载 列表
名称 | 说明 | |
---|---|---|
![]() |
Search(String) | 检索特定的配置文件类型的可搜索属性与指定的搜索模式匹配的ProfileBase对象的一个数组。 |
![]() |
Search([]) | 检索特定的配置文件类型的可搜索属性与指定的搜索模式匹配的ProfileBase对象的一个数组。 |
![]() |
Search(OrganizationProfile, String) | 已过时。其可搜索属性与指定的搜索模式匹配的指定的OrganizationProfile对象下 (如ProfileBase对象) 中检索用户和组织的数组。 |
![]() |
Search(OrganizationProfile, []) | 已过时。其可搜索属性与指定的搜索模式匹配的指定的OrganizationProfile对象下 (如ProfileBase对象) 中检索用户和组织的数组。 |
![]() |
Search([], Int32, Nullable<Boolean>) | 返回配置文件特定的子类型,0 表示所有的子类型。 |
页首
备注
是的可搜索的配置文件属性的名字、姓氏、 PreferredName、用户名、办公室、标题、部门、 WorkEmail、 SP SipAddress和帐户名。若要检索多个ProfileType的对象,请使用ProfileSearchManager。
下面的示例演示如何使用此类。
SPSite siteColl = SPContext.Current.Site;
SPServiceContext serviceContext = SPServiceContext.GetContext(siteColl);
UserProfileManager upm = new UserProfileManager(serviceContext);
//Use either the string or the array of strings
//string[] searchPattern = { "User", "UserOne"};
string searchPattern = "User";
ProfileBase[] searchResults = upm.Search(searchPattern);
foreach (ProfileBase profile in searchResults)
{
Console.WriteLine(profile.DisplayName);
}