SPFarm.GetObject 方法 (String, Guid, Type)
返回指定的对象,根据其关联的名称、 GUID 和类型。
命名空间: Microsoft.SharePoint.Administration
程序集: Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)
语法
声明
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
类型:System.String一个字符串,包含该对象的名称。
parentId
类型:System.GuidSystem.Guid标识该对象的父级。
type
类型:System.TypeSystem.Type表示的对象的类型。
返回值
类型:Microsoft.SharePoint.Administration.SPPersistedObject
SPPersistedObject 对象,该对象表示与 GUID 和类型相关联的对象。
备注
若要返回名为MyWeb的 Web 应用程序对象,调用GetObject方法,如下所示:
SPFarm.GetObject("MyWeb", SPWebService, SpWebApplication)