I have been playing around with the Vista sidebar. There are a lot of really neat gadgets that you can download for it. One disappointment was that I couldn’t find a gadget that showed me my computer’s IP address. There are some that show you the IP address for your wireless card, but for a desktop computer that is about worthless.
After some investigation, I figured out why I couldn’t find a gadget to show me my address. The sidebar has a good API for things like cpu % used, mem % used, and wireless configuration, but not the ip address for an ethernet card. I figured out how to do that after spending some quality time with Google.
The trick is to use WMI along with javascript or vbscript. I finally finished my IP status gadget tonight. It displays the following:
- LAN IP address.
- Optionally, it will also show your public IP address (through a helper asp page).
- A flyout that shows all available information on your card (DNS servers, DHCP Server, Lease expiration, etc.).
- A settings dialog to let you put in the asp page url to get your public IP address.
I am quite satisfied with it at this point. Everything has been coded in vbscript. It seems like most of the examples that you find are coded in javascript. Some samples mix and match between the two. But for this I decided to just use vbscript. Now if only I could figure out how to put it in a seperate file!
<edit> It was accepted this afternoon and is available to download. Like all sidebar gadgets, this is free. Click here to try it! </edit>