Monitoring battery or power supply of laptop from java

前端 未结 5 1888
失恋的感觉
失恋的感觉 2020-12-18 07:46

I am developing an application which monitors the presence of the power supply of the laptop. If there is a power cut or restoration it will intimate me over email. It will

5条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-18 08:15

    A quick and dirty way to handle this is call a native program (via Runtime.exec(...)) and parse the output. On Windows, the native program might be VBScript that uses WMI.

提交回复
热议问题