Share via


IWMSFileDescription Object (C#)

banner art

Previous Next

IWMSFileDescription Object (C#)

You can use the IWMSFileDescription object to describe a directory, content file, or playlist file.

The IWMSFileDescription object exposes the following properties.

Property Description
Name Retrieves the name of a directory, media file, or playlist file.
Type Retrieves an enumeration value that indicates whether the IWMSFileDescription object describes a directory, a media file, or a playlist file.

Example Code

The following example illustrates how to retrieve an IWMSFileDescription object.

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

// Declare variables.
WMSServer                   Server;
IWMSFileDescriptions        FileDescriptions;
IWMSFileDescription         FileDescription;

string                      strPath;

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

    // Retrieve the IWMSFileDescriptions object.
    strPath = "file://c:\\wmpub\\wmroot";
    FileDescriptions = Server.get_FileDescriptions(strPath,
                                      WMS_FILE_TYPE.WMS_FILE_UNSPECIFIED);

    // Retrieve information associated with each description.
    for (int i = 0; i < FileDescriptions.Count; i++)
    {
        FileDescription = FileDescriptions[i];
    }
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

See Also

Previous Next