Saturday, June 07, 2008

I had a couple submissions for ideas to use in today's application, but decided I would use one of my own. Friday night and all: girlfriends like to go out on Friday evenings, we need to go shopping, and later we want to watch a little TV together, so I didn't feel tonight was the best night for a big project.

My idea is a simple yet very useful application for generating random passwords.

image

Pocket PasswordGen

Nothing too fancy here. It's a good looking application, but it didn't take much to make it so. Just clean layout and simple design. I did add a horizontal ruler line between the inputs and the outputs. It is actually two panels set to 1 pixel high each with ones back color set to light blue and the other pure white. The form's background is just a little off-white to add some warmth, but it is hard to tell directly.

The application engine is also clean and simple. There is a password class that has properties for each of the options, and there are two methods: Generate, and ConvertToPhonetic.

I have four character groups:

     static string  lowerCase = @"abcdefghijklmnopqrstuvwyxz";
     static string upperCase = @"ABCDEFGHIJKLMNOPQRSTUVWYXZ";
     static string numbers = @"0123456789";
     static string punctuation = @"~!@#$%^&*()-+='"",.?";

Based on options the user chooses a character list is created with all possible characters for the user's password.

Next I Generate PasswordLength worth's of characters for the password.

This is very important. I use RNGCryptoServiceProvider to generate a random seed number for the random number generator. We want real random numbers, not wishy-washy random numbers. This is a good source for how to use Crypto providers to make a password generator.

Pretty cool code, so check it out if you haven't ever generated random numbers before.

I pulled the Phonetic Alphabet off Wikipedia and made it into a generic dictionary object.

Lastly, I added a menu item that allow users to copy the password to their clipboard. I had to write some code to copy text into the clipboard. This is the best code I could find for doing so.

BTW, there is a bug in the above screenshot. Fixed in the current release. Can you see it? It's subtle. It has to do with the handle the last character. Good luck finding it.

Download executable: passwordGen.cab

Download Source Code: passwordGen.zip

Feedback

Nothing but positive feedback so far. I really appreciate. It seems we are off to a good start. Still I have another 24 days left, and only a handful of ideas I really like. So don't keep that good idea to yourself. One comment on the blog and you might have yourself your first Windows Mobile custom application.


Saturday, June 07, 2008 11:02:38 (Eastern Standard Time, UTC-05:00)
How about a program to manually rotate from portrait to landscape, the millions of new HTC Diamond owners would love that :-)
Alex
Saturday, June 07, 2008 17:05:03 (Eastern Standard Time, UTC-05:00)
How about an application that shows how do debug issues that happen in the field. And a way to get the line number of where the problem occured. I've written apps but had to do my own logging to figure out what was going on. Of course it would be nice to have line numbers in stack traces but if you have any other ideas of debugging, I would love to hear them too.
Will
Sunday, June 08, 2008 03:41:17 (Eastern Standard Time, UTC-05:00)
Cool demos so far! Recently I wanted to start developing an application which would save all sent/received sms messages in a text file and delete the directories. But without success...
helios
Saturday, June 14, 2008 11:21:34 (Eastern Standard Time, UTC-05:00)
Thanks Helios

I like the idea of a SMS Logger. I have added it to my list. Keep checking back to see if and when it is released!
Tuesday, June 17, 2008 08:24:27 (Eastern Standard Time, UTC-05:00)
Hm, on my PPC PasswordGen crashes - with Missing Mode Exception. File or assembly name 'System.Windows.Forms, version 3.5.0.0, Culture=neutral,Publikkeytoken=969DB8053D3322AC' or one of its dependencies, was not found.
Mobile 5. Do i need search for new version of .NET CF ?
Andres
Comments are closed.

Theme design by Jelle Druyts

Pick a theme: