//Leng 随机数的子长 public string CreateRnd(int Leng) { string Ar1 = "A,B,C,D,E,F,G,H,J,K,L,M,N,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9"; string[] ListAr = Ar1.Split(','); Random RD = new Random(); int rnd = 0; string strRnd = ""; for (int j = 1; j < Leng; j++) { rnd = RD.Next(0, ListAr.Length); strRnd += ListAr[rnd]; } return strRnd; }