共用方式為


IWMSPlugin.LoadType (Visual Basic .NET)

The LoadType property specifies and retrieves an enumeration value that indicates whether the server loads authentication, event notification, and authorization plug-ins as in-process or out-of-process objects.

Plugin.LoadType = WMS_PLUGIN_LOAD_TYPE
WMS_PLUGIN_LOAD_TYPE = Plugin.LoadType

Property Value

A member of a WMS_PLUGIN_LOAD_TYPE enumeration type. This must be one of the following values.

Value

Description

WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED

The server determines whether to load the plug-in as an in-process or out-of-process object.

WMS_PLUGIN_LOAD_TYPE_IN_PROC

The plug-in is loaded as an in-process object.

WMS_PLUGIN_LOAD_TYPE_OUT_OF_PROC

The plug-in is loaded as an out-of-process object.

If this property fails, it returns an error number.

Number

Description

0xC00D1453L

The load type is not supported by the plug-in.

Remarks

If this property is set to WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED, the server loads plug-ins as in-process objects. However, if the UnsupportedLoadType property of a plug-in specifies that it cannot be loaded in-process, the plug-in will be loaded out-of-process.

Example

Imports Microsoft.WindowsMediaServices.Interop
Imports System.Runtime.InteropServices

Private Sub GetLoadType()

    ' Declare variables.
    Dim Server As WMSServer
    Dim Plugins As IWMSPlugins
    Dim Plugin As IWMSPlugin
    Dim ltLoadType As WMS_PLUGIN_LOAD_TYPE

Try
    ' Create the WMSServer object.
    Server = New WMSServer()

    ' Retrieve the IWMSPlugins object.
    Plugins = Server.Authenticators

    ' Retrieve information about each plug-in.
    For Each Plugin In Plugins

        ' Retrieve the plug-in load type.
        ltLoadType = Plugin.LoadType

        If Not ltLoadType = WMS_PLUGIN_LOAD_TYPE.WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED Then
            Plugin.LoadType = WMS_PLUGIN_LOAD_TYPE.WMS_PLUGIN_LOAD_TYPE_UNSPECIFIED

        End If

    Next

Catch excCom As COMException
    ' TODO: Handle COM exceptions.
Catch exc As Exception
    ' TODO: Handle errors.
Finally
    ' TODO: Clean-up code goes here.
End Try

End Sub

Requirements

Reference: Add a reference to Microsoft.WindowsMediaServices.

Namespace: Microsoft.WindowsMediaServices.Interop.

Assembly: Microsoft.WindowsMediaServices.dll.

Library: WMSServerTypeLib.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Reference

IWMSPlugin Object (Visual Basic .NET)

IWMSPlugin.LoadType (Visual Basic .NET)