|
Page 1 of 1 |
|
|
Back to top |
|
 |
Werelds
Special Little Man
Posts: 15098
Location: 0100111001001100
|
Posted: Tue, 27th Nov 2012 16:05 Post subject: |
|
 |
Same way you'd do it in any .NET application. Just connect to the performance counters, use WMI etcetera. Obviously will only display the information of the machine on which that ASP.NET page is running.
I have some code lying around somewhere that has that extraction part, would be up to you to stuff it into an ASP page, I'll see if I can find it. From the top of my head: System.Diagnostics has most of it; PerformanceCounter and PerformanceCounterCategory are the classes you'll need. With the second you can find the list of NICs (something like new PerformanceCounterCategory(<category>), can't remember exactly what it is for NICs) as string[]. You then iterate through that, get the PC instance names and fetch the actual data with new PerformanceCounter(<category>, <statistic>, <name of NIC>). Statistic in this case is an actual, full string like "Bytes Received" and such, no constants or anything.
If you're looking to make some sensor data and such available via that page as well, I can only advise against it. Check out http://openhardwaremonitor.org/ and its source code to see how ridiculously complex that gets (it has an HTTP component these days as well btw). Part of its source code is mine from a year or 2-3 ago (WMI interface and most of the CPU and SMART code was rewritten by me) and I'll tell you one thing, it's a fucking pain in the ass for anything that's not available via WMI 
|
|
Back to top |
|
 |
|
|
Back to top |
|
 |
Werelds
Special Little Man
Posts: 15098
Location: 0100111001001100
|
Posted: Tue, 27th Nov 2012 19:44 Post subject: |
|
 |
No problem. Stuff like that will always require a bit more work 
|
|
Back to top |
|
 |
Page 1 of 1 |
All times are GMT + 1 Hour |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB 2.0.8 © 2001, 2002 phpBB Group
|
|
 |
|