Generate random number

xiaoxiao2021-03-06  84

Generate random number

Public Static String Makerand (String S, INT LEN)

{

/ / Return a random number, select from S, then return to the random number of LEN length

IF (s == null || s == ")" "String: s not null";

String tmpstr = ""

IND IRANDNUM;

Random rnd = new random ();

For (int i = 0; i

{

IRANDNUM = rnd.next (s.ley);

Tmpstr = s [IRANDNUM];

}

Return Tmpstr;

}

Public Static String Makerand (int LEN)

{

// Upset the overload version of the last function

String Str;

Str = "Abcdefghijklmnopqrstuvwxyz0123456789abcdefghijklmnopqrstuvwxyz";

Return Makerand (STR, LEN);

}

转载请注明原文地址:https://www.9cbs.com/read-121734.html

New Post(0)