Vb6 How do I make a Random String of 0-9 and a-z of x characters

后端 未结 8 1906
無奈伤痛
無奈伤痛 2021-02-14 03:29

Trying to create a random string, x characters in length using 0-9 and a-z/A-Z and can\'t seem to find a good example, any ideas?

8条回答
  •  滥情空心
    2021-02-14 04:02

    Use Randomize
    Int(Rnd * high bound) + (low bound) will generate a random number
    Generate an array with values from asc("a") to asc("z") and from asc("0") to asc("9")
    Generate random number between 1 and 26 (10+26) and look it up in array.

    Don't have VB6 installed anymore.

提交回复
热议问题