共用方式為


RoleDefinitionCollection.GetById 方法

傳回集合中的角色定義的指定的識別碼。

命名空間:  Microsoft.SharePoint.Client
組件:   Microsoft.SharePoint.Client.Silverlight (在 Microsoft.SharePoint.Client.Silverlight.dll 中);  Microsoft.SharePoint.Client.Phone (在 Microsoft.SharePoint.Client.Phone.dll 中)  Microsoft.SharePoint.Client (在 Microsoft.SharePoint.Client.dll 中)

語法

'宣告
Public Function GetById ( _
    id As Integer _
) As RoleDefinition
'用途
Dim instance As RoleDefinitionCollection
Dim id As Integer
Dim returnValue As RoleDefinition

returnValue = instance.GetById(id)
public RoleDefinition GetById(
    int id
)

參數

  • id
    類型:System.Int32

    指定角色定義搜尋的唯一識別碼。Id 的值會對應到角色定義集合中的索引,但指的是 RoleDefinition Id屬性的值。

傳回值

類型:Microsoft.SharePoint.Client.RoleDefinition
表示角色定義RoleDefinition物件。

例外狀況

例外狀況 條件
ArgumentException

角色定義不存在於集合中指定的範圍。錯誤碼 ︰-2147024809。

請參閱

參照

RoleDefinitionCollection 類別

RoleDefinitionCollection 成員

Microsoft.SharePoint.Client 命名空間