Hello again,I hope this time someone will reply me - my problem is that when I try to write a exe application for measuring the cpu usage every time I get the error:
orCode:A first chance exception of type 'System.InvalidOperationException' occurred in System.dll
The code I use is :Code:A first chance exception of type 'System.FormatException' occurred in mscorlib.dll
And I get the above error,I searched a little in the internet but the most post were for database optimization and so on.Code:Imports System.Diagnostics Dim oPerf1 As New PerformanceCounter oPerf1.CategoryName = "Processor" oPerf1.CounterName = "% Processor Time" oPerf1.InstanceName = "0" Dim I As Integer For I = 0 To 100 SomeListBox.Items.Add (oPerf1.NextValue) Threading.Thread.Sleep (20) Next




Reply With Quote