VB.Net Tutorial/Development/PerformanceCounter — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
(нет различий)
|
Текущая версия на 12:53, 26 мая 2010
System.Diagnostics.PerformanceCounter
public class Test
public Shared Sub Main
Dim PerformanceCounter2 As System.Diagnostics.PerformanceCounter
PerformanceCounter2 = New System.Diagnostics.PerformanceCounter()
Console.WriteLine("Category: " & PerformanceCounter2.CategoryName)
Console.WriteLine("Counter: " & PerformanceCounter2.CounterName)
Console.WriteLine("Instance: " & PerformanceCounter2.InstanceName)
Console.WriteLine("Machine: " & Environment.MachineName)
Console.WriteLine("RawValue: " & PerformanceCounter2.RawValue)
End Sub
End class
Category: Counter: Instance: Machine: vbex Unhandled Exception: System.InvalidOperationException: Failed to initialize because CategoryName is missing. at System.Diagnostics.PerformanceCounter.Initialize() at System.Diagnostics.PerformanceCounter.NextSample() at System.Diagnostics.PerformanceCounter.get_RawValue() at Test.Main()