Share via


IWMDRMProfile.Attributes

Windows Media Encoder SDK banner art

The Attributes property retrieves a collection of user-defined attributes defined in the current DRM profile.

Syntax

IWMDRMAttributes = IWMDRMContentAuthor.Attributes;

Parameters

This property takes no parameters.

Property Value

An IWMDRMAttributes object.

Remarks

This property is read-only.

Once you have used the SetSessionDRMProfile method to specify the DRM profile to use for the current encoding session, you can work with the DRM attributes by using the Attributes property to return an IWMDRMAttributes object. This interface manages a collection of user-defined attributes that provide extra author-defined information that is included in the header of a protected stream or file.

Example Code

using WMEncoderLib;

try 
{
// Create a WMEncoder object.
  WMEncoder Encoder;
  Encoder = new WMEncoder();

// Create an IWMDRMContentAuthor object.
  IWMDRMContentAuthor DRM;
  DRM = Encoder.EncoderDRMContentAuthor;

// Retrieve the collection of DRM profiles.
  IWMDRMProfileCollection DRMProColl;
  DRMProColl = DRM.DRMProfileCollection;

// Create an IWMDRMProfile object and retrieve the first DRM profile
// in the collection.
  IWMDRMProfile DRMPro;
  DRMPro = DRMProColl.Item(0);

// Retrieve an IWMDRMAttributes object from the current DRM profile.
  IWMDRMAttributes Proattr;
  Proattr = DRMPro.Attributes;

// Display the attributes from the current DRM profile.
  object vName;
  object vValue;
  for (int x = 0; x < Proattr.Count; x++)
  {
    vValue = Proattr.Item(x, out vName);
    MessageBox.Show(vName.ToString() & ": " & vValue.ToString());
  }
}

catch (Exception e)
{
     // TODO: Handle exceptions.
}

Requirements

Reference: Windows Media Encoder

Namespace: WMEncoderLib

Assembly: Interop.WMEncoderLib.dll

Library: WMEncoderLib.dll

See Also