<BR><%<BR>function gen_key(digits)<BR>dim rndnum,num<BR>Randomize<BR>Do while Len(rndnum)<digits<BR>num = Cstr(Chr((57-48)*rnd+48))<BR>rndnum = rndnum & num<BR>Loop<BR>gen_key = rndnum<BR>End function<BR>Response.write gen_key(1)<BR>%><BR>想生成几位就几位,只要把1改成相应数字即可<BR>