Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
.gif)
| Previous | Next |
IWMSNamedValue.Value (C#)
The Value property specifies and retrieves the value portion of the name-value pair.
Syntax
IWMSNamedValue .Value = object; object = IWMSNamedValue.Value;
Property Value
An object containing the value portion of the name-value pair.
If this property fails, it throws an exception.
| Number | Description |
| 0x8007000E | There is insufficient memory to complete the function. |
| 0xC00D138BL | object is an unsupported type. |
Remarks
You can use any variant data type except Date.
Example Code
using Microsoft.WindowsMediaServices.Interop;
using System.Runtime.InteropServices;
// Declare variables.
WMSServer Server;
IWMSNamedValues NamedValues;
IWMSNamedValue NamedValue;
object objValue;
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);
// Retrieve the value associated with this pair.
objValue = NamedValue.Value;
// Modify the value associated with this pair.
NamedValue.Value = "New Value";
}
}
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 |