waxdoll 发表于 2008-6-2 15:42:25

有个数据搞不到哪来地,大家帮助看看呗~

forward
global type w_register from w_response
end type
type st_9 from statictext within w_register
end type
type st_8 from statictext within w_register
end type
type st_7 from statictext within w_register
end type
type cb_3 from commandbutton within w_register
end type
type dw_1 from datawindow within w_register
end type
type p_1 from picture within w_register
end type
type st_1 from statictext within w_register
end type
type st_2 from statictext within w_register
end type
type st_3 from statictext within w_register
end type
type st_4 from statictext within w_register
end type
type st_5 from statictext within w_register
end type
type st_6 from statictext within w_register
end type
type sle_user from singlelineedit within w_register
end type
type sle_seria from singlelineedit within w_register
end type
type sle_reg from singlelineedit within w_register
end type
type cb_1 from commandbutton within w_register
end type
type cb_2 from commandbutton within w_register
end type
type cb_4 from commandbutton within w_register
end type
type sle_ck from singlelineedit within w_register
end type
end forward

global type w_register from w_response
integer x = 914
integer y = 752
integer width = 2066
integer height = 1004
string title = "用户注册"
boolean controlmenu = false
long backcolor = 12632256
st_9 st_9
st_8 st_8
st_7 st_7
cb_3 cb_3
dw_1 dw_1
p_1 p_1
st_1 st_1
st_2 st_2
st_3 st_3
st_4 st_4
st_5 st_5
st_6 st_6
sle_user sle_user
sle_seria sle_seria
sle_reg sle_reg
cb_1 cb_1
cb_2 cb_2
cb_4 cb_4
sle_ck sle_ck
end type
global w_register w_register
type prototypes
function boolean getcomputernamea (ref string cname,ref long nbuf)library "Kernel32.dll" alias for "GetComputerNameA"
end prototypes
type variables
public n_cst_numerical inv_numberical_reg
public long il_user = 0
public string is_user
public string is_mess_info
public string is_compname
end variables


on w_register.create
integer icurrent

call super::create;
st_9 = create st_9
st_8 = create st_8
st_7 = create st_7
cb_3 = create cb_3
dw_1 = create dw_1
p_1 = create p_1
st_1 = create st_1
st_2 = create st_2
st_3 = create st_3
st_4 = create st_4
st_5 = create st_5
st_6 = create st_6
sle_user = create sle_user
sle_seria = create sle_seria
sle_reg = create sle_reg
cb_1 = create cb_1
cb_2 = create cb_2
cb_4 = create cb_4
sle_ck = create sle_ck
icurrent = upperbound(control)
control = st_9
control = st_8
control = st_7
control = cb_3
control = dw_1
control = p_1
control = st_1
control = st_2
control = st_3
control = st_4
control = st_5
control = st_6
control = sle_user
control = sle_seria
control = sle_reg
control = cb_1
control = cb_2
control = cb_4
control = sle_ck
end on
on w_register.destroy
call super::destroy;
destroy(st_9)
destroy(st_8)
destroy(st_7)
destroy(cb_3)
destroy(dw_1)
destroy(p_1)
destroy(st_1)
destroy(st_2)
destroy(st_3)
destroy(st_4)
destroy(st_5)
destroy(st_6)
destroy(sle_user)
destroy(sle_seria)
destroy(sle_reg)
destroy(cb_1)
destroy(cb_2)
destroy(cb_4)
destroy(sle_ck)
end on
event open;string ls_rootpath = "c:\"
string ls_user
string ls_volumename = "                                                                                                                                                                                                                                                                "
ulong lul_serial
ulong lul_complen
ulong lul_flag
ulong lul_volumenamesize = 256
ulong lul_systemnamesize = 64
string ls_filesystem = "                                                                "
string ls_inifile
string ls_reg_ini
string ls_user_code
string ls_seria_code
string ls_reg_code
string ls_seria
string ls_ls_reg
string ls_ok
string ls_reg_code1
long ll_pos
long ll_and
long ll_or
long ll_ok
long ll_count
long ll_f
boolean lb_if_reg = false
string ls_seria_code2
string ls_c
string ls_check_code
string ls_ck_code
long ll_buf
string disksn
boolean lb_ret = false
string ls_model
string ls_user0
string ls_subkeylist[]
integer li_rtn
integer li_rtn1
long ll_s
long ll_ln
string ll_reg_name
string ls_tem
string ls_ctrl_code
long loops
string ls_s
string ls_f
long ll_start
long ll_asc
long lla_op[]
long ll_l
long ll_c
string ls_node
long ll_node
long ll_max_node

call super::open;
f_convert_language(this)
movewindcent(this)
ll_buf = 50
is_compname = space(ll_buf)
getcomputernamea(is_compname,ll_buf)
ls_model = space(100)
disksn = space(100)
lb_ret = diskid32(ls_model,disksn)
if lb_ret then
is_mess_info = is_mess_info + "disksn :" + disksn
is_user = trim(disksn)
for ll_f = 1 to len(is_user)
ls_c = mid(is_user,ll_f,1)
choose case asc(ls_c)
   case ((45 , (48 to 57 )) or (65 to 90 )) or (97 to 122 )
    exit
   case else
    is_user = ""
end choose
next
end if
if (( not lb_ret) or isnull(is_user)) or trim(is_user) = "" then
getvolumeinformationa(ls_rootpath,ls_volumename,lul_volumenamesize,lul_serial,lul_complen,lul_flag,ls_filesystem,lul_systemnamesize)
is_user = string(lul_serial)
is_mess_info = "lul_serial :" + string(lul_serial)
end if
if trim(is_user) = "" then
is_user = "E0Lkj03"
end if
ls_user = gf_discidnum(is_user)
if len(ls_user) > 8 then
ls_user = left(ls_user,8)
end if
if isnumber(ls_user) = false then
ls_user = "3503857"
end if
il_user = long(ls_user)
is_mess_info = is_mess_info + ",il_user :" + string(il_user)
sle_user.text = "DXDETS-" + is_user
li_rtn1 = registrykeys("HKEY_LOCAL_MACHINE\Software\Star\reg",ls_subkeylist)
if li_rtn1 = -1 then
lb_if_reg = true
else
registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","user",regstring!,ls_user_code)
registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","seria",regstring!,ls_seria_code)
registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","register",regstring!,ls_reg_code)
registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","check_code",regstring!,ls_check_code)
if isnull(ls_check_code) or ls_check_code = "" then
lb_if_reg = true
else
ls_ck_code = ls_check_code
ls_check_code = gf_uotdense(ls_check_code)
if pos(ls_check_code,"X") = 0 then
   lb_if_reg = true
else
   ll_s = long(left(ls_check_code,pos(ls_check_code,"X") - 1))
   ls_tem = mid(ls_check_code,pos(ls_check_code,"X") + 1)
   if pos(ls_tem,"X") = 0 then
    lb_if_reg = true
   else
    ll_ln = long(left(ls_tem,pos(ls_tem,"X") - 1))
    ls_ctrl_code = mid(ls_tem,pos(ls_tem,"X") + 1)
    ll_reg_name = mid(g_entity_name,ll_s,ll_ln)
    ll_ln = len(ll_reg_name)
    if ll_ln > 4 then
   if mod(ll_ln,4) = 0 then
      loops = ll_ln / 4
   else
      loops = ll_ln / 4 + 1
   end if
    else
   loops = 1
    end if
    ls_s = ll_reg_name
    ll_start = 1
    ll_l = len(mid(ll_reg_name,ll_start))
    do while ll_l <> 0
   ls_f = mid(ll_reg_name,ll_start,loops)
   ll_asc = 0
   for ll_f = 1 to len(ls_f)
      ll_asc = ll_asc + asc(mid(ls_f,ll_f,1))
   next
   lla_op = ll_asc
   ll_start = ll_start + loops
   ll_l = len(mid(ll_reg_name,ll_start))
    loop
    select count ( *) from sys_register where user_code =' ' and seria_code =' ' and reg_code =' 'using sqlca;
/* SQL Parameters List
0-> :ll_c
1-> :ls_user_code
2-> :ls_seria_code
3-> :ls_reg_code
*/
    if isnull(ll_c) then
   ll_c = 0
    end if
    ls_reg_code1 = gf_uotdense(ls_reg_code)
    ls_seria_code2 = ls_seria_code
    if len(ls_reg_code1) = 0 or isnull(ls_reg_code1) or len(ls_user_code) = 0 or isnull(ls_user_code) or len(ls_seria_code) = 0 or isnull(ls_seria_code) then
   lb_if_reg = true
    else
   ls_user_code = mid(ls_user_code,8,len(ls_user_code) - 7)
   ls_seria_code = mid(ls_seria_code,7)
   if ls_user_code <> is_user then
      lb_if_reg = true
   else
      if isnumber(ls_seria_code) = false then
       lb_if_reg = true
      else
       ls_user_code = gf_discidnum(ls_user_code)
       if len(ls_user_code) > 8 then
      ls_user_code = left(ls_user_code,8)
       end if
       ll_and = inv_numberical.of_bitwiseand(long(ls_user_code),lla_op)
       ll_or = inv_numberical.of_bitwiseor(long(ls_seria_code),lla_op)
       ls_ok = string(ll_and) + string(ll_or)
       ll_ok = long(ls_ok)
       ll_and = inv_numberical.of_bitwiseand(ll_ok,lla_op)
       ll_or = inv_numberical.of_bitwiseor(ll_ok,lla_op)
       ls_ok = string(ll_and) + string(ll_or)
       if ls_ok <> ls_reg_code1 then
      lb_if_reg = true
       else
      if ll_c = 0 then
         return
      end if
      sle_seria.text = ls_seria_code2
      sle_reg.text = ls_reg_code
      sle_ck.text = ls_ck_code
      sle_seria.displayonly = true
      sle_reg.displayonly = true
      sle_ck.displayonly = true
      cb_1.enabled = false
      cb_2.text = "关闭(&C)"
      SELECT CAST ( DECRYPT ( sysreg.node , '9U5WnZaY' ) AS CHAR ( 100 ) ) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' 'using sqlca;
/* SQL Parameters List
0-> :ls_node
1-> :ls_seria_code2
*/
      ll_node = long(ls_node)
      select max ( max_node ) from sys_registerusing sqlca;
/* SQL Parameters List
0-> :ll_max_node
*/
      if isnull(ll_max_node) then
         ll_max_node = 0
      end if
      if ll_node > ll_max_node then
         ll_max_node = ll_node
      end if
      if ll_max_node >= 50 then
         st_7.text = f_get_text("不限点","!")
      else
         st_7.text = string(ll_max_node)
      end if
      return
       end if
      end if
   end if
    end if
   end if
end if
end if
end if
if lb_if_reg then
if not f_check_reg(ls_seria_code2) then
else
registrydelete("HKEY_LOCAL_MACHINE\Software\Star\reg","")
end if
end if
return
end event
event key;graphicobject lgo_1

call super::key;
if key = keyenter! then
lgo_1 = getfocus()
if lgo_1 = sle_seria then
sle_reg.setfocus()
end if
if lgo_1 = sle_reg then
cb_1.setfocus()
end if
if lgo_1 = cb_1 then
cb_1.triggerevent(clicked!)
end if
end if
return
end event
event pfc_preopen;call super::pfc_preopen;
if gstr_oem.cotel <> "" then
st_1.text = "咨询电话:" + gstr_oem.cotel
else
st_1.text = ""
end if
if gstr_oem.coemail <> "" then
st_2.text = "电邮:" + gstr_oem.coemail
else
st_2.text = ""
end if
if gstr_oem.coaddr <> "" then
st_3.text = "地址:" + gstr_oem.coaddr
else
st_3.text = ""
end if
end event
type st_9 from statictext within w_register
integer x = 462
integer y = 376
integer width = 439
integer height = 68
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 33554432
long backcolor = 12632256
string text = "注册校验码:"
alignment alignment
boolean focusrectangle = false
end type

type st_8 from statictext within w_register
integer x = 1458
integer y = 160
integer width = 123
integer height = 56
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 16711680
long backcolor = 12632256
string text = "点数"
boolean focusrectangle = false
end type

type st_7 from statictext within w_register
integer x = 1577
integer y = 160
integer width = 206
integer height = 56
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 16711680
long backcolor = 12632256
alignment alignment
boolean focusrectangle = false
end type

type cb_3 from commandbutton within w_register
integer x = 1778
integer y = 36
integer width = 238
integer height = 84
integer taborder = 10
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
string text = "打印(&P)"
end type

event clicked;ulong li_job

li_job = printopen("打印企业动力注册信息")
print(li_job,"")
print(li_job,"")
print(li_job,500,"企业动力注册信息")
print(li_job,1000,"公司名称:" + g_entity_name)
print(li_job,1000,"注册电脑:" + parent.is_compname)
print(li_job,1000,"用户序列号:" + parent.sle_user.text)
print(li_job,1000,"授权序列号:" + parent.sle_seria.text)
print(li_job,1000,"授权注册号:" + parent.sle_reg.text)
print(li_job,1000,"注册校验码:" + parent.sle_ck.text)
print(li_job,"")
print(li_job,1000,"打印时间:" + string(today()) + " " + string(now()))
printclose(li_job)
return
end event
type dw_1 from datawindow within w_register
boolean visible = false
integer x = 197
integer y = 824
integer width = 686
integer height = 400
integer taborder = 60
string title = "none"
string dataobject = "d_sys_register"
boolean livescroll = true
borderstyle borderstyle
end type

event constructor;settransobject(sqlca)
return
end event
type p_1 from picture within w_register
integer width = 439
integer height = 932
boolean bringtotop = true
string picturename = "bmp\reg.bmp"
boolean border = true
borderstyle borderstyle
boolean focusrectangle = false
end type

type st_1 from statictext within w_register
integer x = 453
integer y = 660
integer width = 1321
integer height = 60
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
boolean underline = true
long textcolor = 16711680
long backcolor = 12632256
string text = "咨询电话:020-37604501,37604502,37604503"
boolean focusrectangle = false
end type

type st_2 from statictext within w_register
integer x = 453
integer y = 716
integer width = 1321
integer height = 52
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
boolean underline = true
long textcolor = 16711680
long backcolor = 12632256
string text = "E_Mail:[email protected]"
boolean focusrectangle = false
end type

type st_3 from statictext within w_register
integer x = 453
integer y = 780
integer width = 1321
integer height = 128
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
boolean underline = true
long textcolor = 16711680
long backcolor = 12632256
string text = "地址:广州市环市东路509号宝山大厦16楼"
boolean focusrectangle = false
end type

type st_4 from statictext within w_register
integer x = 462
integer y = 172
integer width = 439
integer height = 60
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 33554432
long backcolor = 12632256
string text = "授权序列号:"
alignment alignment
boolean focusrectangle = false
end type

type st_5 from statictext within w_register
integer x = 462
integer y = 64
integer width = 439
integer height = 60
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 33554432
long backcolor = 12632256
string text = "用户序列号:"
alignment alignment
boolean focusrectangle = false
end type

type st_6 from statictext within w_register
integer x = 462
integer y = 272
integer width = 439
integer height = 60
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 33554432
long backcolor = 12632256
string text = "授权注册号:"
alignment alignment
boolean focusrectangle = false
end type

type sle_user from singlelineedit within w_register
integer x = 896
integer y = 40
integer width = 864
integer height = 84
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 16711680
long backcolor = 12632256
boolean autohscroll = false
boolean displayonly = true
borderstyle borderstyle
end type

type sle_seria from singlelineedit within w_register
integer x = 896
integer y = 148
integer width = 558
integer height = 84
integer taborder = 20
boolean bringtotop = true
integer textsize = -9
integer weight = 700
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 33554432
borderstyle borderstyle
end type

event modified;string ls_xh
string ls_node
integer li_node
long ll_pos

ls_xh = text
SELECT CAST ( DECRYPT ( sysreg.node , '9U5WnZaY' ) AS CHAR ( 100 ) ) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' 'using sqlca;
/* SQL Parameters List
0-> :ls_node
1-> :ls_xh
*/
li_node = integer(ls_node)
if sqlca.sqlcode <> 0 then
messagebox(gs_meg_info,f_get_text("授权序列号错误!","!"))
return
end if
if li_node >= 50 then
parent.st_7.text = f_get_text("不限点","!")
else
parent.st_7.text = string(li_node)
end if
return
end event
type sle_reg from singlelineedit within w_register
integer x = 896
integer y = 256
integer width = 864
integer height = 84
integer taborder = 40
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 33554432
boolean autohscroll = false
borderstyle borderstyle
end type

type cb_1 from commandbutton within w_register
integer x = 896
integer y = 460
integer width = 864
integer height = 84
integer taborder = 50
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
string text = "现在注册(&N)"
end type

event clicked;string ls_seria
string ls_register
string ls_ok
string ls_register2
string ls_seria2
long ll_count
long li_filenum
long ll_and
long ll_or
long ll_seria
long ll_ok
string ls_seria_code
string ls_user_code
string ls_check_code
long ll_pos
long ll_pos2
long ll_node
long ll_no
long ll_max_node
long ll_add_node
string ls_no
string ls_mess
long ll_s
long ll_ln
string ll_reg_name
string ls_tem
string ls_ctrl_code
long loops
string ls_s
string ls_f
long ll_start
long ll_asc
long lla_op[]
long ll_l
long ll_f
string ls_node
long ll_newrow
long ll_found
integer li_rtn

ls_seria = trim(parent.sle_seria.text)
ls_mess = "ls_seria:" + ls_seria + ", "
if len(ls_seria) = 0 or isnull(ls_seria) then
f_messagebox("提示","请输入授权序列号!",stopsign!,ok!,1)
parent.sle_seria.setfocus()
return
end if
ls_register2 = trim(parent.sle_reg.text)
ls_mess = ls_mess + "ls_register2:" + ls_register2 + ", "
ls_register = gf_uotdense(trim(parent.sle_reg.text))
ls_mess = ls_mess + "ls_register:" + ls_register + ", "
ls_check_code = trim(parent.sle_ck.text)
if isnull(ls_check_code) or ls_check_code = "" then
f_messagebox("提示","请输入注册校验码!",stopsign!,ok!,1)
parent.sle_ck.setfocus()
return
end if
ls_check_code = gf_uotdense(ls_check_code)
if pos(ls_check_code,"X") = 0 then
f_messagebox("校验码错误","请输入正确的注册校验码!",stopsign!,ok!,1)
parent.sle_ck.setfocus()
return
end if
ll_s = long(left(ls_check_code,pos(ls_check_code,"X") - 1))
ls_tem = mid(ls_check_code,pos(ls_check_code,"X") + 1)
if pos(ls_tem,"X") = 0 then
f_messagebox("校验码错误","请输入正确的注册校验码!!",stopsign!,ok!,1)
parent.sle_ck.setfocus()
return
end if
ll_ln = long(left(ls_tem,pos(ls_tem,"X") - 1))
ls_ctrl_code = mid(ls_tem,pos(ls_tem,"X") + 1)
ll_reg_name = mid(g_entity_name,ll_s,ll_ln)
ll_ln = len(ll_reg_name)
if ll_ln > 4 then
if mod(ll_ln,4) = 0 then
loops = ll_ln / 4
else
loops = ll_ln / 4 + 1
end if
else
loops = 1
end if
ls_s = ll_reg_name
ll_start = 1
ll_l = len(mid(ll_reg_name,ll_start))
do while ll_l <> 0
ls_f = mid(ll_reg_name,ll_start,loops)
ll_asc = 0
for ll_f = 1 to len(ls_f)
ll_asc = ll_asc + asc(mid(ls_f,ll_f,1))
next
lla_op = ll_asc
ll_start = ll_start + loops
ll_l = len(mid(ll_reg_name,ll_start))
loop
if len(ls_register) = 0 or isnull(ls_register) then
if not f_check_reg(ls_seria) then
else
f_messagebox("提示","请输入授权注册号!",stopsign!,ok!,1)
parent.sle_reg.setfocus()
return
end if
end if
ls_seria2 = ls_seria
SELECT COUNT ( *) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' 'using sqlca;
/* SQL Parameters List
0-> :ll_count
1-> :ls_seria2
*/
if ll_count = 0 or isnull(ll_count) then
f_messagebox("授权序列号错误","输入的授权序列号不正确,请输入正确的序列号!",stopsign!,ok!,1)
ls_mess = ls_mess + "reg_code:" + ls_seria2 + f_get_text("(输入的授权序列号不正确), ","!")
li_filenum = fileopen("regerror.txt",streammode!,write!,lockwrite!,append!)
filewrite(li_filenum,ls_mess)
fileclose(li_filenum)
parent.sle_seria.setfocus()
return
end if
SELECT CAST ( DECRYPT ( sysreg.node , '9U5WnZaY' ) AS CHAR ( 100 ) ) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' 'using sqlca;
/* SQL Parameters List
0-> :ls_node
1-> :ls_seria2
*/
ll_node = long(ls_node)
select max ( max_node ) from sys_registerusing sqlca;
/* SQL Parameters List
0-> :ll_max_node
*/
if isnull(ll_max_node) then
ll_max_node = 0
end if
if ll_node > ll_max_node then
ll_max_node = ll_node
end if
if ll_max_node >= 50 then
ll_max_node = 1000
end if
if not f_check_reg(ls_seria) then
ll_max_node = 1000
end if
ll_add_node = f_get_reg_node(ls_seria)
ls_seria_code = mid(ls_seria,7)
ll_seria = long(ls_seria_code)
ls_mess = ls_mess + "ll_seria:" + string(ll_seria) + ", "
ls_mess = ls_mess + "il_user:" + string(parent.il_user) + ", "
ll_and = parent.inv_numberical_reg.of_bitwiseand(parent.il_user,lla_op)
ll_or = parent.inv_numberical_reg.of_bitwiseor(ll_seria,lla_op)
ls_ok = string(ll_and) + string(ll_or)
ll_ok = long(ls_ok)
ll_and = parent.inv_numberical_reg.of_bitwiseand(ll_ok,lla_op)
ll_or = parent.inv_numberical_reg.of_bitwiseor(ll_ok,lla_op)
ls_ok = string(ll_and) + string(ll_or)
ls_mess = ls_mess + "ls_ok:" + ls_ok + ", "
if ls_register <> ls_ok then
if not f_check_reg(ls_seria) then
else
f_messagebox("提示:注册号错误","请输入正确的授权注册号!!",stopsign!,ok!,1)
ls_mess = ls_mess + "ls_register <> ls_ok time:" + string(today()) + string(now())
ls_mess = parent.is_mess_info + ";~t" + ls_mess + "######~t"
li_filenum = fileopen("regerror.txt",streammode!,write!,lockwrite!,append!)
filewrite(li_filenum,ls_mess)
fileclose(li_filenum)
parent.sle_reg.setfocus()
return
end if
end if
ls_mess = ls_mess + "ls_register = ls_ok time:" + string(today()) + string(now())
ls_mess = parent.is_mess_info + ";~t" + ls_mess + "######~t"
li_filenum = fileopen("regerror.txt",streammode!,write!,lockwrite!,append!)
filewrite(li_filenum,ls_mess)
fileclose(li_filenum)
ls_user_code = "DXDETS-" + parent.is_user
parent.dw_1.retrieve()
ll_found = parent.dw_1.find("computer = '" + parent.is_compname + "' and user_code ='" + ls_user_code + "' and seria_code = '" + ls_seria + "'",1,parent.dw_1.rowcount())
if ll_found > 0 then
parent.dw_1.object.computer = parent.is_compname
parent.dw_1.object.user_code = ls_user_code
parent.dw_1.object.seria_code = ls_seria
parent.dw_1.object.reg_code = ls_register2
else
if parent.dw_1.rowcount() < ll_max_node + ll_add_node then
ll_newrow = parent.dw_1.insertrow(0)
ll_no = ll_newrow
ll_found = parent.dw_1.find("no >" + string(ll_no),1,parent.dw_1.rowcount())
do while ll_found > 0
   ll_no = parent.dw_1.object.no
   ll_found = parent.dw_1.find("no >" + string(ll_no),1,parent.dw_1.rowcount())
loop
if ll_no > ll_newrow then
   ll_no ++
end if
parent.dw_1.object.no = ll_no
parent.dw_1.object.computer = parent.is_compname
parent.dw_1.object.user_code = ls_user_code
parent.dw_1.object.seria_code = ls_seria
parent.dw_1.object.reg_code = ls_register2
parent.dw_1.object.node = ll_newrow
parent.dw_1.object.max_node = ll_max_node
parent.dw_1.object.check_code = trim(parent.sle_ck.text)
else
if f_messagebox(gs_meg_info,"注册节点数已经达到授权数,不能新增注册节点。~r~n如果要继续注册将会替代一个以前注册的节点,~r~n是否继续注册?",question!,yesno!,2) = 2 then
   f_messagebox(gs_meg_info,"注册节点数已经达到授权数,注册尚未完成!",stopsign!,ok!,1)
   return
end if
open(w_register_list)
ls_no = message.stringparm
if trim(ls_no) = "" or isnull(ls_no) or ( not isnumber(ls_no)) then
   messagebox(gs_meg_info,"注册尚未完成!")
   return
else
   parent.dw_1.retrieve()
   ll_found = parent.dw_1.find("no =" + ls_no,1,parent.dw_1.rowcount())
   if ll_found < 1 then
    f_messagebox(gs_meg_info,"发生错误,注册尚未完成!!",stopsign!,ok!,1)
    return
   end if
   parent.dw_1.object.computer = parent.is_compname
   parent.dw_1.object.user_code = ls_user_code
   parent.dw_1.object.seria_code = ls_seria
   parent.dw_1.object.reg_code = ls_register2
   parent.dw_1.object.check_code = trim(parent.sle_ck.text)
end if
end if
end if
for ll_f = 1 to parent.dw_1.rowcount()
parent.dw_1.object.no = ll_f
parent.dw_1.object.max_node = ll_max_node
if parent.dw_1.object.node <> ll_f then
parent.dw_1.object.node = ll_f
end if
next
if parent.dw_1.update() = -1 then
rollback using sqlca;
f_messagebox("提示","提交错误,注册失败!",stopsign!,ok!,1)
return
else
registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","user",regstring!,"DXDETS-" + parent.is_user)
registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","seria",regstring!,ls_seria)
registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","check_code",regstring!,trim(parent.sle_ck.text))
li_rtn = registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","register",regstring!,ls_register2)
if li_rtn = 1 then
commit using sqlca;
if ll_max_node >= 50 then
   parent.st_7.text = f_get_text("不限点","!")
else
   parent.st_7.text = string(ll_max_node)
end if
f_messagebox(gs_meg_info,"注册成功!",information!,ok!,1)
setnull(gl_expire_dates)
closewithreturn(parent,"1")
else
rollback using sqlca;
f_messagebox("提示","写注册表失败,注册失败!",stopsign!,ok!,1)
end if
end if
return
end event
type cb_2 from commandbutton within w_register
integer x = 896
integer y = 556
integer width = 864
integer height = 84
integer taborder = 70
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
string text = "以后注册(&L)"
end type

event clicked;closewithreturn(parent,"0")
return
end event
type cb_4 from commandbutton within w_register
integer x = 1778
integer y = 144
integer width = 238
integer height = 84
integer taborder = 30
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
string text = "保存(&S)"
end type

event clicked;string docname
string named
integer value
integer li_filenum

value = getfilesavename("保存为",docname,named,"TXT","Text Files (*.TXT),*.TXT,Doc Files (*.DOC), *.DOC")
changedirectory(gs_current_directory)
if value = 1 then
if fileexists(docname) then
filedelete(docname)
end if
li_filenum = fileopen(docname,linemode!,write!,lockwrite!,append!)
filewrite(li_filenum,"企业动力注册信息")
filewrite(li_filenum,"公司名称:" + g_entity_name)
filewrite(li_filenum,"注册电脑:" + parent.is_compname)
filewrite(li_filenum,"用户序列号:" + parent.sle_user.text)
filewrite(li_filenum,"授权序列号:" + parent.sle_seria.text)
filewrite(li_filenum,"授权注册号:" + parent.sle_reg.text)
filewrite(li_filenum,"注册校验码:" + parent.sle_ck.text)
fileclose(li_filenum)
end if
return
end event
type sle_ck from singlelineedit within w_register
integer x = 896
integer y = 360
integer width = 864
integer height = 84
integer taborder = 50
boolean bringtotop = true
integer textsize = -9
integer weight = 400
fontcharset fontcharset
fontpitch fontpitch
string facename = "宋体"
long textcolor = 33554432
borderstyle borderstyle
end type

waxdoll 发表于 2008-6-2 15:43:20

注册校验码


不知道哪来地

waxdoll 发表于 2008-6-4 13:36:35

难道没人帮助一下嘛?
55555555555555555555555555

cur 发表于 2008-6-4 19:52:52

看不懂哦 什么意思啊???一头雾水

waxdoll 发表于 2008-6-6 15:13:51

。。。

是我没说明白啊,郁闷……
页: [1]
查看完整版本: 有个数据搞不到哪来地,大家帮助看看呗~