ASP generates a 0~9,a~z 36 string, running the following example requires the IE core Browser, and other non-IE core browsers do not support VBScript.
Implementation code:
<script language= "VBScript" > Function getinitstring (L) "Initializes a specified length of 0 strings l=l-1 for i=0 to L getinitstring=" 0 "&ge Tinitstring Next End Function function Getnextchar (chrcode) ' Gets the next character if chrcode=57 then ' number and the alphabetic ASCII are incoherent and require special handling GetNext Char= "A" Else GETNEXTCHAR=CHR (chrcode+1) End-If End Function function Getnextno (s,l) ' Gets the string of 1 if trim (s) = "then" initial The string getnextno=getinitstring (L): Exit Function End If L=len (s)-1 Dim A (): ReDim A (L) for i=0 to L ' split into array A (i) =mid (s,i +1,1 next Carry=false ' carry flag for i=l to 0 step-1 ' start at the lowest bit chrcode=asc (A (i)) if carry then if chrcode<>122 Then ' is not Z, after the increment exit for loop, otherwise continue carrying a (i) =getnextchar (Chrcode): Exit For ' exit loop ElseIf i=0 Then ' getnextno= ' has reached its maximum length, cannot continue carrying, need To modify Length ": Exit Function End If End If if a (i) =" Z "then carry=true:a (i) =" 0 "Else A (i) =getnextchar (Chrcode): Exit For ' exit Loop End If Next for i=0 to L ' combination return string getnextno=getnextno&a (i) Next End Function s= "" Initlen=6 S=getnextn O (S,initlen) MsgBox S ' 000000 S=getnextno (S,initlen) MsgBox S ' 000001 s= "aaazzz" S=getnextno (S,initlen) MsgBox S ' aab000 s= "zzzzzz" S=getnextno (s)
Initlen) MsgBox S ' has reached its maximum length, cannot continue carrying, need to modify length </script>