asp生成不需要数据库的中奖码(11)


end function

'PrivateKey,尽量复杂一些,开始使用后,就不能更改了。
dim keyinfokey
keyinfokey = "51windows.net@1234567890!@#$%^&*()QWERFGHJK"

'得到中奖码
function getkey()
    skey = getrnddatenum()
    skey2 = md5(skey & keyinfokey)
    getkey = skey & skey2
end function


'验证中奖码
function ckkey(s)
    strs = s
    if len(strs)<> 34 then
        ckkey = false
        exit function
    end if
    datenum = left(strs,18)
    md5oldstr = right(strs,16)
    md5str = md5(datenum & keyinfokey)
    if lcase(md5str) = lcase(md5oldstr) then
        ckkey = true
    else
        ckkey = false
    end if
end function
%>