竟然这样赤裸裸的求代码~~要不要支持一下论坛建设
ConsoleWrite(generate_license() & @CRLF)
Func generate_license()
Local $license = '', $LICENSE_CHARS = "L23456789ABCDEFGHJKMNPQRSTUVWXYZ";
For $i = 1 To 22
$license &= StringMid($LICENSE_CHARS, Random(1, StringLen($LICENSE_CHARS), 1), 1)
Next
For $i = 0 To 1
Local $p = 0;
For $j = 0 To 15 Step 2
$p += StringInStr($LICENSE_CHARS, StringMid($license, $i + $j + 1, 1)) - 1;
Next
$license &= StringMid($LICENSE_CHARS, Mod($p, StringLen($LICENSE_CHARS)) + 1, 1)
Next
Local $arr = StringRegExp($license, '\w{6}', 3)
Local $ret = ''
For $i = 0 To UBound($arr) - 1
$ret &= $arr[$i] & '-'
Next
Return StringTrimRight($ret, 1)
EndFunc ;==>generate_license
|