This documentation is archived and is not being maintained.

PropertyDataCollection.Remove Method

Removes a PropertyData from the PropertyDataCollection.

[Visual Basic]
Public Overridable Sub Remove( _
   ByVal propertyName As String _
)
[C#]
public virtual void Remove(
 string propertyName
);
[C++]
public: virtual void Remove(
 String* propertyName
);
[JScript]
public function Remove(
   propertyName : String
);

Parameters

propertyName
The name of the property to be removed.

Remarks

Properties can only be removed from class definitions, not from instances. This method is only valid when invoked on a property collection in a ManagementClass.

Example

[C#] 
ManagementClass c = new ManagementClass("MyClass");
c.Properties.Remove("PropThatIDontWantOnThisClass");
   
[Visual Basic] 
Dim c As New ManagementClass("MyClass")
c.Properties.Remove("PropThatIDontWantOnThisClass")
   

[C++, JScript] No example is available for C++ or JScript. To view a Visual Basic or C# example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

.NET Framework Security: 

See Also

PropertyDataCollection Class | PropertyDataCollection Members | System.Management Namespace

Show: