Random String Generator
Function
Public
string
RandomString()
{
StringBuilder
objSB = new
StringBuilder();
Random
objRandom = new
Random();
char
ch;
for
(int
i = 0; i < 4; i++)
{
ch
= Convert.ToChar(Convert.ToInt32(Math.Floor(26
* objRandom.NextDouble() + 65)));
int
x = objRandom.Next(1, 4);
if
(x == i)
ch =
Convert.ToChar(ch.ToString().ToUpper());
else
ch =
Convert.ToChar(ch.ToString().ToLower());
objSB.Append(ch);
}
return
objSB.ToString();
}
ok Good One .... How to validate whether client enter the text and captcha text ..., Please give suggessions
ReplyDeleteDear Murthy,
ReplyDeleteIt's not a Captcha, It's a Random String Generator......