日期:2014-05-17 浏览次数:20908 次
<% Response.Write getPrjNum() Function getPrjNum() getPrjNum = Right(Year(Date),2) & genNum(8, 8) & UCase(genStr(1,1)) End Function Function randNum(lowerbound, upperbound) Randomize Time() randNum = Int((upperbound - lowerbound + 1) * Rnd + lowerbound) End Function Function genStr(n, m) Dim a, z, s, i, p a = Asc("a") z = Asc("z") s = "" p = randNum(n, m) For i = 1 To p s = s & Chr(randNum(a, z)) Next genStr = s End Function Function genNum(n, m) Dim a, z, s, i, p a = Asc("0") z = Asc("9") s = "" p = randNum(n, m) For i = 1 To p s = s & Chr(randNum(a, z)) Next genNum = s End Function %>