PerformanceCounterCategory コンストラクタ ()
アセンブリ: System (system.dll 内)


この PerformanceCounterCategory インスタンスをサーバー上のパフォーマンス オブジェクトに関連付ける前に、CategoryName プロパティを設定する必要があります。設定しないと、例外がスローされます。

PerformanceCounterCategory 名およびコンピュータ名をコマンド ラインから受け取るコード例を次に示します。この例では、指定されたパラメータの数に適したコンストラクタ オーバーロードを使用して、PerformanceCounterCategory を作成し、プロパティを表示します。
Sub Main(ByVal args() As String) Dim categoryName As String = "" Dim machineName As String = "" Dim pcc As PerformanceCounterCategory ' Copy the supplied arguments into the local variables. Try categoryName = args(0) machineName = IIf(args(1) = ".", "", args(1)) Catch ex As Exception ' Ignore the exception from non-supplied arguments. End Try ' Create a PerformanceCounterCategory object using ' the appropriate constructor. If categoryName.Length = 0 Then pcc = New PerformanceCounterCategory ElseIf machineName.Length = 0 Then pcc = New PerformanceCounterCategory(categoryName) Else pcc = New PerformanceCounterCategory(categoryName, machineName) End If ' Display the properties of the PerformanceCounterCategory object. Try Console.WriteLine(" Category: {0}", pcc.CategoryName) Console.WriteLine(" Computer: {0}", pcc.MachineName) Console.WriteLine(" Help text: {0}", pcc.CategoryHelp) Catch ex As Exception Console.WriteLine("Error getting the properties of the " & _ "PerformanceCounterCategory object:") Console.WriteLine(ex.Message) End Try End Sub


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PerformanceCounterCategory クラス
PerformanceCounterCategory メンバ
System.Diagnostics 名前空間
CategoryName
MachineName
PerformanceCounter クラス
PerformanceCounterCategory コンストラクタ (String)
アセンブリ: System (system.dll 内)



PerformanceCounterCategory 名およびコンピュータ名をコマンド ラインから受け取るコード例を次に示します。この例では、指定されたパラメータの数に適したコンストラクタ オーバーロードを使用して、PerformanceCounterCategory を作成し、プロパティを表示します。
Sub Main(ByVal args() As String) Dim categoryName As String = "" Dim machineName As String = "" Dim pcc As PerformanceCounterCategory ' Copy the supplied arguments into the local variables. Try categoryName = args(0) machineName = IIf(args(1) = ".", "", args(1)) Catch ex As Exception ' Ignore the exception from non-supplied arguments. End Try ' Create a PerformanceCounterCategory object using ' the appropriate constructor. If categoryName.Length = 0 Then pcc = New PerformanceCounterCategory ElseIf machineName.Length = 0 Then pcc = New PerformanceCounterCategory(categoryName) Else pcc = New PerformanceCounterCategory(categoryName, machineName) End If ' Display the properties of the PerformanceCounterCategory object. Try Console.WriteLine(" Category: {0}", pcc.CategoryName) Console.WriteLine(" Computer: {0}", pcc.MachineName) Console.WriteLine(" Help text: {0}", pcc.CategoryHelp) Catch ex As Exception Console.WriteLine("Error getting the properties of the " & _ "PerformanceCounterCategory object:") Console.WriteLine(ex.Message) End Try End Sub


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PerformanceCounterCategory クラス
PerformanceCounterCategory メンバ
System.Diagnostics 名前空間
CategoryName
MachineName
PerformanceCounter クラス
PerformanceCounterCategory コンストラクタ (String, String)
アセンブリ: System (system.dll 内)

Dim categoryName As String Dim machineName As String Dim instance As New PerformanceCounterCategory(categoryName, machineName)


PerformanceCounterCategory 名およびコンピュータ名をコマンド ラインから受け取るコード例を次に示します。この例では、指定されたパラメータの数に適したコンストラクタ オーバーロードを使用して、PerformanceCounterCategory を作成し、プロパティを表示します。
Sub Main(ByVal args() As String) Dim categoryName As String = "" Dim machineName As String = "" Dim pcc As PerformanceCounterCategory ' Copy the supplied arguments into the local variables. Try categoryName = args(0) machineName = IIf(args(1) = ".", "", args(1)) Catch ex As Exception ' Ignore the exception from non-supplied arguments. End Try ' Create a PerformanceCounterCategory object using ' the appropriate constructor. If categoryName.Length = 0 Then pcc = New PerformanceCounterCategory ElseIf machineName.Length = 0 Then pcc = New PerformanceCounterCategory(categoryName) Else pcc = New PerformanceCounterCategory(categoryName, machineName) End If ' Display the properties of the PerformanceCounterCategory object. Try Console.WriteLine(" Category: {0}", pcc.CategoryName) Console.WriteLine(" Computer: {0}", pcc.MachineName) Console.WriteLine(" Help text: {0}", pcc.CategoryHelp) Catch ex As Exception Console.WriteLine("Error getting the properties of the " & _ "PerformanceCounterCategory object:") Console.WriteLine(ex.Message) End Try End Sub


Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


PerformanceCounterCategory クラス
PerformanceCounterCategory メンバ
System.Diagnostics 名前空間
CategoryName
MachineName
PerformanceCounter クラス
PerformanceCounterCategory コンストラクタ

名前 | 説明 |
---|---|
PerformanceCounterCategory () | PerformanceCounterCategory クラスの新しいインスタンスを初期化し、CategoryName プロパティを空のままにし、MachineName プロパティをローカル コンピュータに設定します。 |
PerformanceCounterCategory (String) | PerformanceCounterCategory クラスの新しいインスタンスを初期化し、CategoryName プロパティを指定した値に設定し、MachineName プロパティをローカル コンピュータに設定します。 |
PerformanceCounterCategory (String, String) | PerformanceCounterCategory クラスの新しいインスタンスを初期化し、CategoryName プロパティと MachineName プロパティを指定した値に設定します。 |

関連項目
PerformanceCounterCategory クラスPerformanceCounterCategory メンバ
System.Diagnostics 名前空間
CategoryName
MachineName
PerformanceCounter クラス
- PerformanceCounterCategory コンストラクタ ()のページへのリンク