Differences
This shows you the differences between two versions of the page.
— | development:vbs:random_string [2019/10/31 09:05] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== VBScript: Random string ====== | ||
+ | <code vbnet> | ||
+ | Function RndStr( ByVal intLen ) | ||
+ | Dim tmp | ||
+ | Dim intRnd | ||
+ | Const constCHARS = " | ||
+ | Randomize | ||
+ | intRnd=Len(constCHARS)+1 | ||
+ | For i = 1 to intLen | ||
+ | do until intRnd< | ||
+ | intRnd = int(Rnd*100) | ||
+ | loop | ||
+ | tmp = tmp & Mid( constCHARS, intRnd ,1 ) | ||
+ | intRnd=Len(constCHARS)+1 | ||
+ | Next | ||
+ | RndStr = tmp | ||
+ | End Function | ||
+ | </ | ||
+ | Usage | ||
+ | <code bash> |