Win32APIã使ãã require 'Win32API' GetSystemPower = Win32API.new('kernel32', 'GetSystemPowerStatus', "p", 'n') data = "\0" * 12 while true day = Time.now day = Time.now.strftime("%Y/%d %X") ret = GetSystemPower.call(data) items = data.unpack("C*") puts day + ", " + items[2].to_s sleep 60 end Posted at 2011å¹´03æ01æ¥ 00:00
{{#tags}}- {{label}}
{{/tags}}