/// <summary>
/// 隨機(jī)生成字符串
/// </summary>
/// <param name="codeCount">字符串個(gè)數(shù)</param>
/// <returns></returns>
private string GenerateCheckCode(int codeCount)
{
int number;
char code;
string checkCode = String.Empty;
System.Random random = new Random();
for(int i=0; i<codeCount; i++)
{
number = random.Next();
if(number % 2 == 0)
code = (char)('0' + (char)(number % 10));
else
code = (char)('A' + (char)(number % 26));
checkCode += code.ToString();
}
return checkCode;
}