自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

c# Windows CE讀取電池電量的實(shí)現(xiàn)

開發(fā) 后端
c# Windows CE讀取電池電量的實(shí)現(xiàn)向你介紹了如何使用代碼實(shí)現(xiàn)c# Windows CE讀取電池電量的功能。

c# Windows CE讀取電池電量的實(shí)現(xiàn)是如何的呢?讓我們來(lái)看看:

  1. [DllImport("coredll.dll")]  
  2.   public static extern uint   
  3. GetSystemPowerStatusEx2(  
  4. ref SYSTEM_POWER_STATUS_EX2 pSystemPowerStatusEx2,    
  5. int dwLen, int fUpdate);  
  6.  
  7.   public struct SYSTEM_POWER_STATUS_EX2  
  8.   {  //c# Windows CE讀取電池電量的實(shí)現(xiàn)
  9.    public byte ACLineStatus;  
  10.    public byte BatteryFlag;  
  11.    public byte BatteryLifePercent;  
  12.    public byte Reserved1;  
  13.    public uint BatteryLifeTime;  
  14.    public uint BatteryFullLifeTime;  
  15.    public byte Reserved2;  
  16.    public byte BackupBatteryFlag;  
  17.    public byte BackupBatteryLifePercent;  
  18.    public byte Reserved3;  
  19.    public uint BackupBatteryLifeTime;  
  20.    public uint BackupBatteryFullLifeTime;  
  21.    public uint BatteryVoltage;  
  22.    public uint BatteryCurrent;  
  23.    public uint BatteryAverageCurrent;  
  24.    public uint BatteryAverageInterval;  
  25.    public uint BatterymAHourConsumed;  
  26.    public uint BatteryTemperature;  
  27.    public uint BackupBatteryVoltage;  
  28.    public byte BatteryChemistry;  
  29.   }  
  30.  //c# Windows CE讀取電池電量的實(shí)現(xiàn)
  31.  
  32.    
  33.  
  34. c# Windows CE讀取電池電量的實(shí)現(xiàn)的調(diào)用:  
  35.  
  36. //c# Windows CE讀取電池電量的實(shí)現(xiàn)之取電量  
  37.    WinCE.SYSTEM_POWER_STATUS_EX2 status = new   
  38. WinCE.SYSTEM_POWER_STATUS_EX2();  
  39.    hr=WinCE.GetSystemPowerStatusEx2(ref status,  
  40.  System.Runtime.InteropServices.Marshal.SizeOf(status), 1); 

c# Windows CE讀取電池電量的實(shí)現(xiàn)就向你介紹到這里,希望對(duì)你了解c# Windows CE讀取電池電量的實(shí)現(xiàn)有所幫助。

【編輯推薦】

  1. C#Windows應(yīng)用程序開發(fā)之創(chuàng)建窗體
  2. C#Windows應(yīng)用程序開發(fā)之窗體控件
  3. C#Windows應(yīng)用程序開發(fā)之添加菜單
  4. C#Windows應(yīng)用程序開發(fā)之添加狀態(tài)條
  5. C#Windows應(yīng)用程序開發(fā)之事件處理器
責(zé)任編輯:仲衡 來(lái)源: 網(wǎng)易博客
相關(guān)推薦

2009-08-17 09:57:00

C# Windows

2009-08-17 10:29:58

C# Windows

2009-08-17 09:39:40

C# Windows

2009-08-17 10:11:12

C# Windows

2009-08-17 10:26:34

C# Windows

2009-08-17 10:17:01

C# Windows

2009-08-17 10:02:58

C# Windows

2009-08-17 10:22:19

C# Windows

2009-08-13 10:15:50

C#讀取Excel

2009-08-12 17:19:09

C#讀取文件內(nèi)容

2009-08-12 16:26:30

C#讀取XML文檔

2009-08-12 18:29:06

C#讀取TXT文件

2009-04-11 15:12:24

Windows CE串行通信GPS

2009-08-07 12:57:03

C#讀取Excel

2009-09-02 19:08:03

C#實(shí)現(xiàn)讀取文本文件

2021-12-19 13:53:03

Windows 11Windows電池

2009-08-25 16:16:27

C#調(diào)用Windows

2009-08-20 12:35:41

C#讀取圖片的EXIF

2021-12-17 07:30:44

Windows 11操作系統(tǒng)微軟

2021-01-21 08:17:23

Linux電池充放電狀態(tài)
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)