IWMSOnDemandPublishingPoint.ExportXML (C#)
Previous | Next |
IWMSOnDemandPublishingPoint.ExportXML (C#)
The ExportXML method creates a file containing publishing point configuration data.
Syntax
IWMSOnDemandPublishingPoint .ExportXML( String strXMLFileName );
Parameters
strXMLFileName
[in] string containing the name of the XML file.
Return Values
This method does not return a value.
If this method fails, it throws an exception.
Number | Description |
0x00000003 | The path indicated by strXMLFileName was not found. |
0xC00D145AL | The publishing point has already been removed. |
Remarks
You can use the XML file to create a new publishing point with the same settings as the existing publishing point.
This method requires the Network Service account to have write and browse access to the specified path.
Example Code
using Microsoft.WindowsMediaServices.Interop; using System.Runtime.InteropServices; // Declare variables. WMSServer Server; IWMSPublishingPoints PubPoints; IWMSPublishingPoint PubPoint; IWMSOnDemandPublishingPoint ODPubPoint; string strFile; try { // Create a new WMSServer object. Server = new WMSServerClass(); // Retrieve the IWMSPublishingPoints object. PubPoints = Server.PublishingPoints; // Retrieve each publishing point and retrieve the // IWMSOnDemandPublishingPoint object. for (int i = 0; i < PubPoints.Count; i++) { PubPoint = PubPoints[i]; if (PubPoint.Type == WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_ON_DEMAND) { ODPubPoint = (IWMSOnDemandPublishingPoint)PubPoint; // Export the publishing point configuration // information to an XML file. strFile = "c:\\wmpub\\wmroot\\odpubpoint.xml"; ODPubPoint.ExportXML (strFile); break; } } } 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
Previous | Next |