SPUtility.GetPrincipalsInGroup method
會取得對指定之群組的使用者或群組。指定的群組可以是 Microsoft Windows 安全性群組、 ASP.NET角色或 SharePoint 群組。
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
<DirectoryServicesPermissionAttribute(SecurityAction.Assert, Unrestricted := True)> _
Public Shared Function GetPrincipalsInGroup ( _
web As SPWeb, _
input As String, _
maxCount As Integer, _
<OutAttribute> ByRef reachedMaxCount As Boolean _
) As SPPrincipalInfo()
'用途
Dim web As SPWeb
Dim input As String
Dim maxCount As Integer
Dim reachedMaxCount As Boolean
Dim returnValue As SPPrincipalInfo()
returnValue = SPUtility.GetPrincipalsInGroup(web, _
input, maxCount, reachedMaxCount)
[DirectoryServicesPermissionAttribute(SecurityAction.Assert, Unrestricted = true)]
public static SPPrincipalInfo[] GetPrincipalsInGroup(
SPWeb web,
string input,
int maxCount,
out bool reachedMaxCount
)
參數
web
Type: Microsoft.SharePoint.SPWeb目前使用者有BrowseUserInfo權限的網站。
input
Type: System.String若要查詢的群組。
maxCount
Type: System.Int32若要傳回的成員數目上限。
reachedMaxCount
Type: System.Boolean資訊是否已達到的成員數目上限。
傳回值
Type: []
true如果有多個成員未傳回 ;否則,請false。
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | web或input參數,則a null reference (Nothing in Visual Basic)。 |
ArgumentException | maxCount參數小於 0。 |