IWMSNamedValues.get_Item (C#)

banner art

Previous Next

IWMSNamedValues.get_Item (C#)

The get_Item method retrieves a name-value pair from the IWMSNamedValues collection.

Syntax

  IWMSNamedValue = IWMSNamedValues.get_Item(
  object  varIndex
);

Parameters

varIndex

[in] object containing either the name portion of the name-value pair or an index into the collection. The maximum size of a name is 250 characters.

Property Value

An IWMSNamedValue object. You can use this object to retrieve the name-value pair.

If this method fails, it throws an exception.

Number Description
0x8002000B varIndex is an invalid index location.

Remarks

If you enter an integer index and no matching index is found in the collection, the get_Item method returns an error.

Example Code

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

// Declare variables.
WMSServer                   Server;
IWMSNamedValues             NamedValues;
IWMSNamedValue              NamedValue;

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

    // Retrieve the IWMSNamedValues object
    // containing descriptive information about the server.
    NamedValues = Server.Properties;

    // Retrieve information about each name-value pair.
    for (int i = 0; i < NamedValues.Count; i++)
    {
        NamedValue = NamedValues.get_Item(i);
    }
}
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