Brian read my previous post and quickly replied with this functionally identical C# code:
string schars = "0124356789abcdefghijk";
string password = string.Empty;
Random rand = new Random(DateTime.Now.Millisecond);
while (password.Length < 9) password += schars[rand.Next(0, schars.Length)];
The only real difference is the rand seeding. I still find the Ruby easier to understand thanks to the upto method and the fact that numbers are objects in Ruby. Thanks for the code though Brian.
Add New Comment
Viewing 1 Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks
(Trackback URL)