IWMSServer.Status (Visual Basic .NET)

banner art

Previous Next

IWMSServer.Status (Visual Basic .NET)

The Status property retrieves an enumeration value indicating the current state of the server.

Syntax

  WMS_SERVER_STATUS = IWMSServer.Status

Property Value

A member of a WMS_SERVER_STATUS enumeration type representing the current state of the server. This must be one of the following values.

Value Description
WMS_SERVER_RUNNING The server is running.
WMS_SERVER_ERROR A non-critical error has occurred.
WMS_SERVER_ERROR_CRITICAL A critical error has occurred.

Remarks

This property is read-only.

Example Code

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

Private Sub GetServerStatus()

    ' Declare variables.
    Dim Server As WMSServer
    Dim ssStatus As WMS_SERVER_STATUS

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

    ' Retrieve the status of the server.
    ssStatus = Server.Status

    If ssStatus = WMS_SERVER_STATUS.WMS_SERVER_RUNNING Then
        ' TODO: Handle server running status.
    ElseIf ssStatus = WMS_SERVER_STATUS.WMS_SERVER_ERROR Then
        ' TODO: Handle server error status.
    ElseIf ssStatus = WMS_SERVER_STATUS.WMS_SERVER_ERROR_CRITICAL Then
        ' TODO: Handle server critical error status.
    End If

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

Previous Next