TOGGIT - IN SEARCH OF CERTIFICATION
 TOGGIT
     IN SEARCH OF CERTIFICATION
    
     
  
TOGGIT IN SEARCH OF CERTIFICATION

Visual Basic .Net Sample Code and Applications

MAIN
Logon to ToggIT
Join ToggIT
Home
Home
Contact Us
Career Building
Certification Maps
Partners
Technopedia
.Net Source Code
Free Networking Tools
Free IT Publications
Microsoft
2003 Certifications
270 Win XP Pro
290 2003 Server
291 2003 Network Inf
293 Plan Network inf
294 2003 Active Directory
224 Exchange 2000
DBA Certifications
228 SQL 2000
229 SQL 2000
MCSD Certifications
526 Windows Apps
305 ASP.NET
2000 Certifications
210 Professional
215 Server
216 Network inf.
217 Directory Svc.
218 Managing 2K
219 Design Dir Svc.
220 Design Security
270 Win XP Pro
221 Design Net Inf.
Cisco
CCNA
CompTia
A+ Hardware 2003!
A+ Software 2003!
Network+
Security+
New Wireless
CWNP program
Java 
Java Goodies 



MCSE Top-Rated Sites



 

Join Toggit Now!
Avoid Annoying Ads!

 Your Email:

 New Password:

See the list of .Net articles
Microsoft Visual Basic .Net Programming

Are you working with Microsoft Visual Basic .NET? We have put together some code samples to answer some common "How to" questions.
 

How Do I...Read from a performance counter?


Windows performance counters enable your applications and components to publish, capture (read), and analyze the performance data that applications, services, and drivers provide. You can use this information to determine system bottlenecks and fine-tune system and application performance. For example, you can use a performance counter to track the number of orders processed per second or a system's processor utilization. Using the common language runtime's PerformanceCounter component, you can easily read performance data relevant to your application, such as those mentioned above.

This sample illustrates how to read simple performance information from a performance counter. 

In its simplest form, reading a performance counter involves:

Creating a new instance of a PerformanceCounter component and pointing it to an appropriate performance counter:

The syntax for creating the counter object looks like this:

counter = New PerformanceCounter(objectName, counterName, instanceName)

This code assumes that you have a windows form with a timer and a label in it. The time should be enabled and set the interval to 1000 to read the counter every second. The example uses the Processor object, the % Processor Time counter and the _Total instance:
 


In a timer tick event Place this code. The NextValue method of the performance counter object will return the current value of the counter. This code places the value in a label
 
Label1.Text = counter.NextValue()

 
You can declare and monitor as many performance counters as you want.
 
See the list of .Net articles

 

TOGGIT      IN SEARCH OF CERTIFICATION

All information on this site is copyright ToggIT.com unless otherwise specified. Material submitted or posted this site may also contain materials that are copyrights of individual contributors. It is illegal to copy, publish, reproduce, or distribute any materials from this site with the express permission of the owner of this material.

The material on this web site is not sponsored by, endorsed by or affiliated with Microsoft, Inc, CompTIA, or Cisco Systems, Inc. Microsoft, Inc.® ,Windows XP, Windows 2000, Windows 2000 Server, Windows 98, Windows NT, Visual Basic, Visual C++, Visual FoxPro, SQL server and Microsoft logos are trademarks or registered trademarks of Microsoft,  Inc. in the United States and certain other countries. A+, Server+, and Network+ are all registered trademarks of CompTIA. CCNA, CCNE, and the Cisco logo are all registered trademarks of Cisco Systems. All other trademarks are trademarks of their respective owners.