IWMSBroadcastPublishingPoint.ExportXML (Visual Basic .NET)
.gif)
| Previous | Next |
IWMSBroadcastPublishingPoint.ExportXML (Visual Basic .NET)
The ExportXML method creates an XML file containing publishing point configuration data.
Syntax
IWMSBroadcastPublishingPoint .ExportXML( strXMLFileName As String )
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 returns an error number.
| Number | Description |
| 0x8007000E | The strXMLFileName argument is invalid. This can occur if an empty string is passed in. |
| 0x00000003 | The path indicated by the strDestinationFileName could not be found. |
| 0xC00D145AL | The publishing point has already been removed. |
Remarks
You can use the IWMSPublishingPoints.ImportXML method to create a new publishing point with the same settings as the current broadcast publishing point.
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 CreateXMLFile()
' Declare variables.
Dim Server As WMSServer
Dim PubPoints As IWMSPublishingPoints
Dim PubPoint As IWMSPublishingPoint
Dim BCPubPoint As IWMSBroadcastPublishingPoint
Dim strFile As String
Dim i As Integer
Try
' Create the WMSServer object.
Server = New WMSServer()
' Retrieve the IWMSPublishingPoints object.
PubPoints = Server.PublishingPoints
' Retrieve each publishing point and retrieve the
' IWMSBroadcastPublishingPoint object.
For i = 0 To Server.PublishingPoints.Count – 1
PubPoint = PubPoints.Item(i)
If PubPoint.Type = WMS_PUBLISHING_POINT_TYPE.WMS_PUBLISHING_POINT_TYPE_BROADCAST Then
BCPubPoint = PubPoint
Exit For
End If
Next i
' Export the publishing point configuration
' information to an XML file.
strFile = "c:\wmpub\wmroot\pubpoint.xml"
BCPubPoint.ExportXML(strFile)
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
- IWMSBroadcastPublishingPoint Object (Visual Basic .NET)
- IWMSPublishingPoints.ImportXML (Visual Basic .NET)
| Previous | Next |