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 );
- The name of the custom performance counter category to delete.
|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.|
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.
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:
- PerformanceCounterPermissionAccess for performing administrative tasks on performance counter categories.