IWMSServer.ExportXML (C#)

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

IWMSServer.ExportXML(
  string  strXMLFileName 
);

Arguments

strXMLFileName

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

Return Value

This method does not return a value.

If this method fails, it throws an exception.

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

using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;

// Declare variables.
WMSServer   Server;
string      strText;

try {
    // Create a new WMSServer object.
    Server = new WMSServerClass();

    // Export the server configuration to a file.
    strText = "c:\\wmpub\\wmroot\\server.xml";
    Server.ExportXML (strText);
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

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

IWMSServer Object (C#)