My.Power makes it easier for a developer to do things like shut down the user's computer or get the computer's battery level. Here is what My.Power includes:
  • Shutdown
Usage: My.Computer.Shutdown()
  • Logoff
Usage: My.Computer.Logoff()
  • Restart
Usage: My.Computer.Restart()
  • Sleep
Usage: My.Computer.Sleep()
  • Hibernate
Usage: My.Computer.Hibernate()
  • BatteryPercent_S
This returns the computer's battery charge percent as a string.

Usage: My.Computer.BatteryPercent_S(boolean) (In place of boolean, type True or False. True means that it will add the % symbol to the end; False will just return the number as a string.)
  • BatteryPercent New!
This returns the computer's battery percent as an integer or double. (This needs to be verified.)
  • PowerLineStatus
This returns whether or not the user's computer is plugged in. It will return either "Plugged In" or "On Battery" as a string.

Usage: My.Computer.PowerLineStatus()
  • LockSystem
Usage: My.Computer.LockSystem()
  • AbortShutdown
Usage: My.Computer.AbortShutdown()

Last edited Jun 4, 2012 at 4:06 PM by drummerboy0511, version 3


No comments yet.