SPFarm.GetObject method (String, Guid, Type)
會傳回指定的物件及其相關聯的名稱、 GUID 和類型為基礎。
Namespace: Microsoft.SharePoint.Administration
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'宣告
Public Function GetObject ( _
name As String, _
parentId As Guid, _
type As Type _
) As SPPersistedObject
'用途
Dim instance As SPFarm
Dim name As String
Dim parentId As Guid
Dim type As Type
Dim returnValue As SPPersistedObject
returnValue = instance.GetObject(name, _
parentId, type)
public SPPersistedObject GetObject(
string name,
Guid parentId,
Type type
)
參數
name
Type: System.String包含物件的名稱的字串。
parentId
Type: System.GuidSystem.Guid可識別物件的父代。
type
Type: System.TypeSystem.Type代表物件的類型。
傳回值
Type: Microsoft.SharePoint.Administration.SPPersistedObject
SPPersistedObject 物件,代表關聯的 GUID 和類型的物件。
備註
若要傳回呼叫MyWeb的 Web 應用程式物件,請呼叫GetObject方法,如下所示所示:
SPFarm.GetObject("MyWeb", SPWebService, SpWebApplication)