摘要:
(转载)C#---WINCE 电池状态(2011-08-18 14:26:20)转载▼标签: wince电池电量状态c类杂谈 分类: 计算机程序设计 using System;using System.Collections.Generic;using System.Runtime.InteropServices;using System.Drawing;namespace BatteryControl{ /// /// Author /// Date /// Addr /// Func Battery Show /// public... 阅读全文
摘要:
wmi的Win32_Battery类实现其中EstimatedChargeRemaining属性返回剩余电量的百分比,EstimatedRunTime属性返回剩余时间(分钟)其他属性参考http://msdn2.microsoft.com/en-us/library/aa394074.aspx我写了一个示范代码返回剩余电量的百分比首先在引用里添加System.Management核心代码如下:using System.Management;....ObjectQuery oq = new ObjectQuery("select * from Win32_Battery"); 阅读全文