Wow, today was a busy day. I gave a Windows Mobile Programming presentation today at a .NET user group I help run, PDANUG. I changed it up at the very last minute, and instead of doing the presentation I was planing on doing we wrote a Windows Mobile application together. It was great. I think everyone contributed, and got something out of it. In the end we had a very nice Prize Picker application that we will be able to use again and again in the future. And I have a new talk that I can present. Any takers?
What is My IP?
You may have seen sites like WhatIsMyIP.com, IPChicken.com, and my favorite IPCow.com. Most people prefer command prompt and good ole IPConfig. But sometimes when you are troubleshooting an issue with a friend of family member over the phone that’s not always the best idea. Usually in those kind of situations it is easier to send someone to a Web site and just have them read the value to you. I think some of the sites above will render appropriately on a mobile device, pretty sure IPCow.com does.
But what if you can’t connect to the Internet, and you need to see your Intranet IP address. In this case, and many others, one wants something a little more direct, and clear.
For this reason, “What is My IP?” exists. It couldn’t be simpler. Run the program, then see your IP address, or IP addresses in case you have multiple connections open. Which is very possible with today’s devices, with everything from Bluetooth, cellular connections, wireless connections, and more.
This application only does one thing, so it needs to do it very well. And it needs to be appealing in how it looks and how it does it.
Since the application has minimal features, it has a minimalist style to it. There is only one focus point of attention and that is the large network icon in the center of the screen. Everything else is clean and simple.
There’s only one method of note in this application: RefreshData()
1: private void RefreshData()
2: {
3: string deviceName = System.Net.Dns.GetHostName();
4:
5: textBoxDeviceName.Text = deviceName;
6:
7: IPAddress[] addresses = Dns.GetHostEntry(deviceName).AddressList;
8:
9: comboBoxDeviceIP.Items.Clear();
10: for (int i = 0; i < addresses.Length; i++)
11: comboBoxDeviceIP.Items.Add(addresses[i].ToString());
12:
13: if (comboBoxDeviceIP.Items.Count > 0)
14: comboBoxDeviceIP.SelectedIndex = 0;
15: }
Download executable: whatIsMyIP.cab
Download Source Code: whatIsMyIP.zip
Feedback
Not bad 10 applications in 10 days. Won’t be long before we’re at 20 applications in 20 days, and then 30 applications in 30 days. Keep the feedback coming.