IWMSPublishingPoint.FileDescriptions (Visual Basic .NET)

banner art

Previous Next

IWMSPublishingPoint.FileDescriptions (Visual Basic .NET)

The FileDescriptions property retrieves an IWMSFileDescriptions collection containing information about files, directories, and playlists in a specified publishing point path.

Syntax

  IWMSFileDescriptions = IWMSPublishingPoint.FileDescriptions(
  strRelativePath As String
)

Parameters

strRelativePath

[in] String containing a subdirectory or file in the base path. You can use the IWMSPublishingPoint.Path property to specify the base path.

Property Value

An IWMSFileDescriptions object. This is NULL if the publishing point path does not contain a directory, media file, or playlist file. You can use the IWMSPublishingPoint.Path property to retrieve the publishing point path.

If this property fails, it returns an error number.

Number Description
0x00000002 The file indicated by strRelativePath was not found.
0x00000003 The path indicated by strRelativePath was not found.
0xC00D1580L The data source plug-in that the server is attempting to use to access the path referenced by strRelativePath does not support enumeration of files.
0xC00D145AL The publishing point was already removed.
0xC00D157EL The server was not able to find a data source plug-in to access the path referenced by strRelativePath.
0xC00D1452L The method is not supported for cache proxy publishing points.

Remarks

This property is read-only. If the publishing point path contains either a media file or playlist file, the IWMSFileDescriptions object will contain information about only that file, and an error is returned if any value other than a zero-length string is specified in the first parameter.

This method is not supported for cache proxy publishing points.

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

Example Code

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

Private Sub GetFileInfo()

    ' Declare variables.
    Dim Server As WMSServer
    Dim PubPoints As IWMSPublishingPoints
    Dim PubPoint As IWMSPublishingPoint
    Dim FileDescriptions As IWMSFileDescriptions
    Dim strText As String

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

    ' Retrieve the IWMSPublishingPoints object.
    PubPoints = Server.PublishingPoints

    ' Retrieve information about each publishing point.
    For Each PubPoint In PubPoints

        ' Retrieve the IWMSFileDescriptions object
        ' containing information about files available to the
        ' publishing point.
        strText = ".\\"
        FileDescriptions = PubPoint.FileDescriptions(strText)

    Next

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