Click here to Skip to main content
12,952,398 members (40,311 online)
Click here to Skip to main content
Add your own
alternative version


14 bookmarked
Posted 31 Mar 2010

My.Power Extension (VSX)

, 31 Mar 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
A My Namespace extension that makes things such as shutting down your computer easier.


I got the idea for this extension while reading an article a while back about extending the My Namespace, and one of the sample ideas suggested in the article was "My.Computer.Shutdown". I did not copy that, but I used it as a base for this extension, making things like turning off a computer, getting laptop battery power, and putting the computer into hibernation. Simple stuff, but done quicker.

Using the Code

To install the extension, download the zip file at the top of this page, extract it, and install the .vsix file into Visual Studio 2010. After that, you can load a Visual Basic project and add My.Power to the project using the Add -> New Item menu button.

Now, you can do things like shut down a user's computer:


If you want to get a battery's charge percent, you can type something like this:

Label1.Text = My.Computer.BatteryPercent		

It's just that easy!

This item template can be installed into Visual Basic 2010 Express Edition, as well as all of the higher-end versions of Visual Studio 2010.

I hope that you find this useful!


  • 31st March, 2010: Initial post


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer
United States United States
I currently have several years' worth of coding experience, including experience with HTML5, CSS3, JavaScript, Java, Visual Basic.NET, jQuery, PHP, and Python.

You may also be interested in...

Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170525.1 | Last Updated 31 Mar 2010
Article Copyright 2010 by drummerboy0511
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid