Share via


IXMLDOMAttribute.value (C#)

banner art

Previous Next

IXMLDOMAttribute.value (C#)

The value property contains the attribute value.

Syntax

  object = IXMLDOMAttribute.value;
IXMLDOMAttribute.value = object;

Remarks

The property is read/write. It returns the value of the attribute.

Example Code

The following example retrieves the value of the first attribute of the document root and assigns it to the variable myVar.

using Microsoft.WindowsMediaServices.Interop;
using interop_msxml;

// Declare variables.
WMSServer Server;
IXMLDOMDocument Playlist;
IXMLDOMElement Root;
object myVar;

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

    // Create a new playlist object.
    Playlist = Server.CreatePlaylist();

    // Load a playlist.
    Playlist.load("file://c:\\wmpub\\wmroot\\simple.wsx");

    // Retrieve the root element.
    Root = Playlist.documentElement;

    // Assign the value from the first attribute of the 
    // root element to the variable myVar.
    myVar = ((IXMLDOMAttribute)Root.firstChild.attributes[0]).value;

    // Display the variable.
    MessageBox.Show(myVar.ToString());
}
catch (Exception e) {
    // TODO: Handle exceptions.
}

Requirements

Reference: Add references to Microsoft.WindowsMediaServices and interop_msxml.

Namespace: Microsoft.WindowsMediaServices.Interop, interop_msxml.

Assembly: Microsoft.WindowsMediaServices.dll, interop_msxml.dll.

Library: WMSServerTypeLib.dll, msxml.dll.

Platform: Windows Server 2003 family, Windows Server 2008 family.

See Also

Previous Next