captcha generation in C#

Raj_Chennai
Posted by Raj_Chennai under C# category on | Points: 40 | Views : 1835
using System;
using System.Collections.Generic;
using System.Text;

namespace captcha
{
class Program
{
static void Main(string[] args)
{
char[] arr ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p',
'q','r','s','t','u','v','w','x','y','z','A','B','C','D','E','F',
'G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V',
'W','X','Y','Z','2','3','4','5','6','7','8','9'};
string passwordString = "";
Random rand = new Random();
for (int i = 0; i < 6; i++)
{
passwordString += arr[rand.Next(0, arr.Length)];
}
Console.WriteLine(passwordString);
Console.ReadLine();
}
}
}

Comments or Responses

Posted by: T.Saravanan on: 3/13/2012 Level:Silver | Status: [Member] [MVP] | Points: 10
Hi Raj,

Nice info. But for looking good,Kindly post your code inside the code tag.
Posted by: Kulprachi84 on: 3/15/2012 Level:Starter | Status: [Member] | Points: 10
Great information.
Posted by: Raj_Chennai on: 3/17/2012 Level:Starter | Status: [Member] | Points: 10
yes i have applied this ...thanks for your sugesstion

Login to post response