C
cnsyj
Unregistered / Unconfirmed
GUEST, unregistred user!
Function RandNum(Types, Len: Integer
Const CustomStr: String = ''): String;
Const CharStr: Array[0..2] Of String = ('0123456789', 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
Var
S: String
i: Integer;
Begin
Randomize;
Case Types Of
0: S := CharStr[0];
1: S := CharStr[1];
2: S := CharStr[2];
3: S := CharStr[0] + CharStr[1];
4: S := CharStr[1] + CharStr[2];
5: S := CharStr[0] + CharStr[2];
End;
S := S + CustomStr;
Result := '';
For i := 1 To Len Do
Result := Result + S[Random(Length(S) - 1) + 1];
End;
下面这句是调用的它。
BeginName := Ini.ReadString('Config', 'BeginName', RandNum(1, 6));
Const CustomStr: String = ''): String;
Const CharStr: Array[0..2] Of String = ('0123456789', 'abcdefghijklmnopqrstuvwxyz', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
Var
S: String
i: Integer;
Begin
Randomize;
Case Types Of
0: S := CharStr[0];
1: S := CharStr[1];
2: S := CharStr[2];
3: S := CharStr[0] + CharStr[1];
4: S := CharStr[1] + CharStr[2];
5: S := CharStr[0] + CharStr[2];
End;
S := S + CustomStr;
Result := '';
For i := 1 To Len Do
Result := Result + S[Random(Length(S) - 1) + 1];
End;
下面这句是调用的它。
BeginName := Ini.ReadString('Config', 'BeginName', RandNum(1, 6));