SPUtility.GetSPListFromName method (SPContext, SPWeb, Guid, String, String, String)
擷取指定的 SharePoint 清單。
Namespace: Microsoft.SharePoint.Utilities
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Shared Function GetSPListFromName ( _
context As SPContext, _
web As SPWeb, _
webId As Guid, _
listGuid As String, _
listUrl As String, _
listDisplayName As String _
) As SPList
'用途
Dim context As SPContext
Dim web As SPWeb
Dim webId As Guid
Dim listGuid As String
Dim listUrl As String
Dim listDisplayName As String
Dim returnValue As SPList
returnValue = SPUtility.GetSPListFromName(context, _
web, webId, listGuid, listUrl, listDisplayName)
public static SPList GetSPListFromName(
SPContext context,
SPWeb web,
Guid webId,
string listGuid,
string listUrl,
string listDisplayName
)
參數
context
Type: Microsoft.SharePoint.SPContextSPContext物件,代表 SharePoint 網站清單所屬的內容。
web
Type: Microsoft.SharePoint.SPWeb代表 SharePoint 網站清單所屬SPWeb物件。
webId
Type: System.GuidSharePoint 網站清單所屬全域唯一識別碼 (GUID)。
listGuid
Type: System.String字串,可提供清單的全域唯一識別碼 (GUID)。
listUrl
Type: System.String字串,可提供清單的 URL。
listDisplayName
Type: System.String提供清單的顯示名稱的字串。
傳回值
Type: Microsoft.SharePoint.SPList
SharePoint 清單中所提供的參數相關聯。
備註
此GetSPListFromName方法會先嘗試比對指定的listGuid,則listUrl,及最後listDisplayName清單。