The following example shows how to use the ManagementKeyAttribute to mark a field as a key property of a WMI class.
[ManagementKey]
public int id;
The next example shows how to use the ManagementKeyAttribute attribute to mark a key property of a WMI class.
[C#]
// Use the ManagementKey attribute to specify that this property
// is used as the key identifier of this class and for the WMI
// instances of this class. This property must be unique for each
// class instance.
[ManagementKey]
public int Id
{
get { return System.Diagnostics.Process.GetCurrentProcess().Id; }
}