SPRoleCollection.GetByID 方法

请注意:此 API 现在已过时。

Obsolete. Use the new SPRoleDefinition and SPRoleAssignment classes instead, to define roles and to assign users to them. For more information, see Changes in the Authorization Object Model. (In Windows SharePoint Services 2.0, the GetByID method returned the role with the specified member ID and is maintained for backward compatibility.)

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
<ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")> _
Public Function GetByID ( _
    id As Integer _
) As SPRole
用法
Dim instance As SPRoleCollection
Dim id As Integer
Dim returnValue As SPRole

returnValue = instance.GetByID(id)
[ObsoleteAttribute("Use the SPRoleDefinitionCollection class instead")]
public SPRole GetByID(
    int id
)

参数

  • id
    类型:System.Int32

    一个 32 位整数,它指定成员 id。

返回值

类型:Microsoft.SharePoint.SPRole
一个表示该角色的SPRole对象。

备注

id参数的值对应于角色,它包含在SPMember类的ID属性中的唯一成员 ID。

另请参阅

引用

SPRoleCollection 类

SPRoleCollection 成员

Microsoft.SharePoint 命名空间