IIS server question
Page 1 of 1
Photish




Posts: 1126

PostPosted: Tue, 27th Nov 2012 15:30    Post subject: IIS server question
Hey gents.

Note : Im a newbie at this!

Right! My question is. How can I create a html file with system information, that continues to update every time the page is reloaded(f5)

More specific, info like this :



So it would look lige this, when I open the html page :




Kinda like a desktop widget(samurize etc) just in a webpage?
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: 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 Smile
Back to top
Photish




Posts: 1126

PostPosted: Tue, 27th Nov 2012 16:18    Post subject:
Thanks for the answer Werelds!

It seems this way above my skills... I have never touched .NET or ASP.
I thought there was an easy way of doing it.

Anyway thanks again Werelds Smile
Back to top
Werelds
Special Little Man



Posts: 15098
Location: 0100111001001100
PostPosted: Tue, 27th Nov 2012 19:44    Post subject:
No problem. Stuff like that will always require a bit more work Smile
Back to top
Page 1 of 1 All times are GMT + 1 Hour
NFOHump.com Forum Index - Programmers Corner
Signature/Avatar nuking: none (can be changed in your profile)  


Display posts from previous:   

Jump to:  
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