mike
mike

Reputation: 3166

C# Query a remote computer for resource usage (i.e. cpu load, ram usage)

Is there some simple way to send out a ping-style message to a remote PC and get back some general facts/figures about the PC in C#? I'd be mostly interested in CPU Load, RAM usage, current running processes, etc. but the more information the merrier (extra info like CPU specs would be cool)!

I imagine in an ideal situation it'd be as simple as pinging a computer, via a simple 3rd party library. I can run custom apps on the remote computers, but it would be awesome if it just worked out of the box.

Upvotes: 1

Views: 4044

Answers (2)

cyberzed
cyberzed

Reputation: 2076

There is a few options...

You can do a simple ping from System.Net.NetworkInformation.Ping ( http://msdn.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx ), and as stated above there is the possibility of using WMI ( http://msdn.microsoft.com/en-us/library/bb404655.aspx ).

You can also checkout other sites for some plain startup code... ( http://www.csharphelp.com/archives2/archive334.html )

Upvotes: 1

Jonas B
Jonas B

Reputation: 2391

Yes you can. With WMI. You can read more about it here: http://en.wikipedia.org/wiki/Windows_Management_Instrumentation

It allows you to send queries to any remote computer you have access to and retrieve a multitude of information

Edit: It might not exactly be as easy as sending a ping request, but when you get the hang of it, it feels very natural.

Upvotes: 3

Related Questions