Delete Method

PerformanceCounterCategory.Delete Method

Removes the category and its associated counters from the local computer.

[Visual Basic]
Public Shared Sub Delete( _
   ByVal categoryName As String _
)
[C#]
public static void Delete(
 string categoryName
);
[C++]
public: static void Delete(
 String* categoryName
);
[JScript]
public static function Delete(
   categoryName : String
);

Parameters

categoryName
The name of the custom performance counter category to delete.

Exceptions

Exception Type Condition
ArgumentNullException The categoryName parameter is a null reference (Nothing in Visual Basic).
ArgumentException The categoryName parameter has invalid syntax. It might contain backslash characters ("\") or have length greater than 80 characters.
Win32Exception A call to an underlying system API failed.
InvalidOperationException The category cannot be deleted because it is not a custom category.

Remarks

You can delete only custom performance counter categories from the system. You cannot delete a counter from a category. To do so, delete the category and recreate the category with the counters you want to retain.

Requirements

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

.NET Framework Security: 

See Also

PerformanceCounterCategory Class | PerformanceCounterCategory Members | System.Diagnostics Namespace | Create

Show:
© 2016 Microsoft