本篇内容主要讲解“c# Windows CE读取电池电量的实现方法”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“c# Windows CE读取电池电量的实现方法”吧!
成都创新互联公司专注于庐山企业网站建设,响应式网站,商城网站制作。庐山网站建设公司,为庐山等地区提供建站服务。全流程定制网站制作,专业设计,全程项目跟踪,成都创新互联公司专业和态度为您提供的服务
c# Windows CE读取电池电量的实现是如何的呢?让我们来看看:
[DllImport("coredll.dll")] public static extern uint GetSystemPowerStatusEx2( ref SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2, int dwLen, int fUpdate); public struct SYSTEM_POWER_STATUS_EX2 { //c# Windows CE读取电池电量的实现 public byte ACLineStatus; public byte BatteryFlag; public byte BatteryLifePercent; public byte Reserved1; public uint BatteryLifeTime; public uint BatteryFullLifeTime; public byte Reserved2; public byte BackupBatteryFlag; public byte BackupBatteryLifePercent; public byte Reserved3; public uint BackupBatteryLifeTime; public uint BackupBatteryFullLifeTime; public uint BatteryVoltage; public uint BatteryCurrent; public uint BatteryAverageCurrent; public uint BatteryAverageInterval; public uint BatterymAHourConsumed; public uint BatteryTemperature; public uint BackupBatteryVoltage; public byte BatteryChemistry; } //c# Windows CE读取电池电量的实现 c# Windows CE读取电池电量的实现的调用: //c# Windows CE读取电池电量的实现之取电量 WinCE.SYSTEM_POWER_STATUS_EX2 status = new WinCE.SYSTEM_POWER_STATUS_EX2(); hr=WinCE.GetSystemPowerStatusEx2(ref status, System.Runtime.InteropServices.Marshal.SizeOf(status), 1);
到此,相信大家对“c# Windows CE读取电池电量的实现方法”有了更深的了解,不妨来实际操作一番吧!这里是创新互联网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!