次の方法で共有


IWMSRootDirectories Object (C#)

The IWMSRootDirectories object contains a collection of root directory paths for the enabled data source plug-ins.

The IWMSRootDirectories object exposes the following properties.

Method

Description

Count

Retrieves the number of root directory paths in the IWMSRootDirectories collection.

length

Retrieves the number of root directory paths in the IWMSRootDirectories collection. This method is provided for JScript compatibility.

In C#, there are two ways to access objects in a collection:

  • Access individual objects directly by using a string (where applicable)

  • Iterate through the objects by using an index

You must use array notation when retrieving objects from a collection, except when using the get_Item method.

Example

The following example illustrates how to retrieve an IWMSRootDirectories object.

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

// Declare variables.
WMSServer                  Server;
IWMSRootDirectories        RootDirectories;

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

    // Retrieve the IWMSRootDirectories object.
    RootDirectories = Server.RootDirectories;
}
catch (COMException comExc) {
    // TODO: Handle COM exceptions.
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

See Also

Concepts

Server Object Model (C#)