Share via


IWMSServer.ExportXML (Visual Basic .NET)

banner art

Previous Next

IWMSServer.ExportXML (Visual Basic .NET)

The ExportXML method creates an XML document containing the server configuration data.

Syntax

  IWMSServer
  .ExportXML(
  strXMLFileName As String
)

Parameters

strXMLFileName

[in] String containing the name of the XML document.

Return Values

If this method succeeds, it does not return a value. If it fails, it returns an error number.

Number Description
0x80070057 strXMLFileName is invalid.
0x00000003 The path indicated by strXMLFileName was not found.

Remarks

You must save the XML document in a file with an .xml extension before you can use it to configure a server.

This method requires the Network Service account to have write and browse access to the specified path.

Example Code

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

Private Sub ExportConfig()

    ' Declare variables.
    Dim Server As WMSServer
    Dim strText As String

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

    ' Export the server configuration to a file.
    strText = "c:\wmpub\wmroot\server.xml"
    Server.ExportXML(strText)

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