#2
yumh19872010-04-23 14:11
|
//Public function gf_check_reg (none) returns integer
string disksn
string ls_reg
string ls_realcode
string ls_id
long ll_count
string instr
string outstr
boolean r
outstr = space(100)
disksn = space(100)
getdisksn(0,disksn)
ls_id = trim(disksn)
select code INTO :ls_reg from G_reg where diskid =:ls_id USING sqlca;
IF isnull(ls_reg) THEN ls_reg = ""
IF ls_reg = "" THEN RETURN 0
ls_reg = trim(ls_reg)
instr = trim(disksn)
r = md5string(instr,len(instr),outstr,100)
ls_realcode = left(trim(outstr),10)
IF r = TRUE THEN //11
IF ls_reg = ls_realcode THEN //12
RETURN 1
ELSE //12
RETURN 0
END IF //12
ELSE //11
RETURN 0
END IF //11
RETURN 0
输入:WD-WCAT16302971
得出:D1CA14C9DF