|
using System;
using System.Collections.Generic;
using System.Text;
namespace CaptchaImage
{
/// <summary>
/// this encapsulate a Random object
/// and some methods to generate formated random code using the random object
/// </summary>
public class RandomHelper
{
private Random random = new Random();
/// <summary>
/// Returns a string of six random digits.
/// </summary>
/// <returns></returns>
public string GenerateRandomCode()
{
string s = "";
for (int i = 0; i < 6; i++)
s = String.Concat(s, this.random.Next(10).ToString());
return s;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
* Bachelor of Information Management at ISAT Charleroi in Belgium.
* Master II of Information science at UMH Mons.
I spend my time in small projects which can help me or small enterprises and
I am very interested in designing projects
with specifications of UML or in applying usual design patterns.