Skip to Main Content
Visual Studio Hacks
book

Visual Studio Hacks

by James Avery
March 2005
Intermediate to advanced content levelIntermediate to advanced
304 pages
19h 23m
English
O'Reilly Media, Inc.
Content preview from Visual Studio Hacks
298
|
Chapter 9, Server Explorer Hacks
#73 Access Performance Counters
HACK
HACK
#73
Access Performance Counters Hack #73
Windows’ performance counters can reveal all sorts of information about the
inner working of your machine. Use the Server Explorer to interact with these
performance counters.
The Server Explorer provides an excellent interface to access the perfor-
mance counters on your computer. Using the Server Explorer, you can drag
performance counters directly from the Server Explorer to your application.
In this hack, you will see how to build a simple application that reads from a
performance counter and reports its value to the user.
The Server Explorer includes a node called Performance Counters, which
can be seen in Figure 9-1.
Each of the nodes you see in Figure 9-1 is a category that includes a number
of performance counters listed beneath it. The contents of the Memory cate-
gory can be seen in Figure 9-2.
Figure 9-1. Server Explorer—Performance Counters node
Access Performance Counters #73
Chapter 9, Server Explorer Hacks
|
299
HACK
From the Server Explorer, you can then drag the performance counter to
your Windows Forms, and you will see the counter show up in the compo-
nent section of your form, as seen in Figure 9-3.
Once the performance counter object has been added to your form, you ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Visual Studio 2015 Unleashed, Third Edition

Microsoft Visual Studio 2015 Unleashed, Third Edition

Mike Snell, Lars Powers
.Net Framework Essentials

.Net Framework Essentials

Thuan L. Thai, Hoang Lam
C# 5.0 Unleashed

C# 5.0 Unleashed

Bart De Smet
Programming .NET Security

Programming .NET Security

Adam Freeman, Allen Jones

Publisher Resources

ISBN: 0596008473Errata Page