M
Marc Gravell
I would like to query (where possible) the power consumption of the local
PC. Obviously this requires hardware support, but similar apps leads me to
believe that this is possible. I looked at wmi (below) but this is empty on
my XP machines... any other ideas on how to get this data? If it is even
possible...
TIA,
Marc
static void Main() {
using (ManagementObjectSearcher query = new
ManagementObjectSearcher("SELECT * FROM Win32_CurrentProbe"))
using (ManagementObjectCollection results = query.Get()) {
Console.WriteLine("{0} current feed(s)", results.Count);
foreach (ManagementObject mo in results) {
Console.WriteLine("{0}: {1}", mo["Caption"],
mo["CurrentReading"]);
}
}
using (ManagementObjectSearcher query = new
ManagementObjectSearcher("SELECT * FROM Win32_VoltageProbe"))
using (ManagementObjectCollection results = query.Get()) {
Console.WriteLine("{0} voltage feed(s)", results.Count);
foreach (ManagementObject mo in results) {
Console.WriteLine("{0}: {1}", mo["Caption"],
mo["CurrentReading"]);
}
}
}
PC. Obviously this requires hardware support, but similar apps leads me to
believe that this is possible. I looked at wmi (below) but this is empty on
my XP machines... any other ideas on how to get this data? If it is even
possible...
TIA,
Marc
static void Main() {
using (ManagementObjectSearcher query = new
ManagementObjectSearcher("SELECT * FROM Win32_CurrentProbe"))
using (ManagementObjectCollection results = query.Get()) {
Console.WriteLine("{0} current feed(s)", results.Count);
foreach (ManagementObject mo in results) {
Console.WriteLine("{0}: {1}", mo["Caption"],
mo["CurrentReading"]);
}
}
using (ManagementObjectSearcher query = new
ManagementObjectSearcher("SELECT * FROM Win32_VoltageProbe"))
using (ManagementObjectCollection results = query.Get()) {
Console.WriteLine("{0} voltage feed(s)", results.Count);
foreach (ManagementObject mo in results) {
Console.WriteLine("{0}: {1}", mo["Caption"],
mo["CurrentReading"]);
}
}
}