共用方式為


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
)

參數

  • parentId
    Type: System.Guid

    System.Guid可識別物件的父代。

  • type
    Type: System.Type

    System.Type代表物件的類型。

傳回值

Type: Microsoft.SharePoint.Administration.SPPersistedObject
SPPersistedObject 物件,代表關聯的 GUID 和類型的物件。

備註

若要傳回呼叫MyWeb的 Web 應用程式物件,請呼叫GetObject方法,如下所示所示:

SPFarm.GetObject("MyWeb", SPWebService, SpWebApplication)

請參閱

參照

SPFarm class

SPFarm members

GetObject overload

Microsoft.SharePoint.Administration namespace