/// <summary>
/// 生成随机字符串,包含数字和小写字母
/// </summary>
/// <param name="VcodeNum">字符串长度</param>
/// <returns></returns>
public static string RndNum(int VcodeNum)
{
string Vchar="0,1,2,3,4,5,6,7,8,9,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";
string[] VcArray=Vchar.Split(new Char [] {','});
string VNum="";
int temp=-1;
Random rand=new Random();
for(int i=1;i<VcodeNum+1;i++)
{
if(temp!=-1)
{
rand=new Random(i*temp*unchecked((int)DateTime.Now.Ticks));
}
int t=rand.Next(VcArray.Length);
if(temp != -1 && temp == t)
{
return RndNum(VcodeNum);
}
temp=t;
VNum+=VcArray[t];
}
return VNum;
}