飘云阁

 找回密码
 加入我们

QQ登录

只需一步,快速开始

查看: 4633|回复: 4

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

[复制链接]

该用户从未签到

发表于 2008-6-2 15:42:25 | 显示全部楼层 |阅读模式
  1. forward
  2. global type w_register from w_response
  3. end type
  4. type st_9 from statictext within w_register
  5. end type
  6. type st_8 from statictext within w_register
  7. end type
  8. type st_7 from statictext within w_register
  9. end type
  10. type cb_3 from commandbutton within w_register
  11. end type
  12. type dw_1 from datawindow within w_register
  13. end type
  14. type p_1 from picture within w_register
  15. end type
  16. type st_1 from statictext within w_register
  17. end type
  18. type st_2 from statictext within w_register
  19. end type
  20. type st_3 from statictext within w_register
  21. end type
  22. type st_4 from statictext within w_register
  23. end type
  24. type st_5 from statictext within w_register
  25. end type
  26. type st_6 from statictext within w_register
  27. end type
  28. type sle_user from singlelineedit within w_register
  29. end type
  30. type sle_seria from singlelineedit within w_register
  31. end type
  32. type sle_reg from singlelineedit within w_register
  33. end type
  34. type cb_1 from commandbutton within w_register
  35. end type
  36. type cb_2 from commandbutton within w_register
  37. end type
  38. type cb_4 from commandbutton within w_register
  39. end type
  40. type sle_ck from singlelineedit within w_register
  41. end type
  42. end forward

  43. global type w_register from w_response
  44. integer x = 914
  45. integer y = 752
  46. integer width = 2066
  47. integer height = 1004
  48. string title = "用户注册"
  49. boolean controlmenu = false
  50. long backcolor = 12632256
  51. st_9 st_9
  52. st_8 st_8
  53. st_7 st_7
  54. cb_3 cb_3
  55. dw_1 dw_1
  56. p_1 p_1
  57. st_1 st_1
  58. st_2 st_2
  59. st_3 st_3
  60. st_4 st_4
  61. st_5 st_5
  62. st_6 st_6
  63. sle_user sle_user
  64. sle_seria sle_seria
  65. sle_reg sle_reg
  66. cb_1 cb_1
  67. cb_2 cb_2
  68. cb_4 cb_4
  69. sle_ck sle_ck
  70. end type
  71. global w_register w_register
  72. type prototypes
  73. function boolean getcomputernamea (ref string cname,ref long nbuf)  library "Kernel32.dll" alias for "GetComputerNameA"
  74. end prototypes
  75. type variables
  76. public n_cst_numerical inv_numberical_reg
  77. public long il_user = 0
  78. public string is_user
  79. public string is_mess_info
  80. public string is_compname
  81. end variables


  82. on w_register.create
  83. integer icurrent

  84. call super::create;
  85. st_9 = create st_9
  86. st_8 = create st_8
  87. st_7 = create st_7
  88. cb_3 = create cb_3
  89. dw_1 = create dw_1
  90. p_1 = create p_1
  91. st_1 = create st_1
  92. st_2 = create st_2
  93. st_3 = create st_3
  94. st_4 = create st_4
  95. st_5 = create st_5
  96. st_6 = create st_6
  97. sle_user = create sle_user
  98. sle_seria = create sle_seria
  99. sle_reg = create sle_reg
  100. cb_1 = create cb_1
  101. cb_2 = create cb_2
  102. cb_4 = create cb_4
  103. sle_ck = create sle_ck
  104. icurrent = upperbound(control)
  105. control[icurrent + 1] = st_9
  106. control[icurrent + 2] = st_8
  107. control[icurrent + 3] = st_7
  108. control[icurrent + 4] = cb_3
  109. control[icurrent + 5] = dw_1
  110. control[icurrent + 6] = p_1
  111. control[icurrent + 7] = st_1
  112. control[icurrent + 8] = st_2
  113. control[icurrent + 9] = st_3
  114. control[icurrent + 10] = st_4
  115. control[icurrent + 11] = st_5
  116. control[icurrent + 12] = st_6
  117. control[icurrent + 13] = sle_user
  118. control[icurrent + 14] = sle_seria
  119. control[icurrent + 15] = sle_reg
  120. control[icurrent + 16] = cb_1
  121. control[icurrent + 17] = cb_2
  122. control[icurrent + 18] = cb_4
  123. control[icurrent + 19] = sle_ck
  124. end on
  125. on w_register.destroy
  126. call super::destroy;
  127. destroy(st_9)
  128. destroy(st_8)
  129. destroy(st_7)
  130. destroy(cb_3)
  131. destroy(dw_1)
  132. destroy(p_1)
  133. destroy(st_1)
  134. destroy(st_2)
  135. destroy(st_3)
  136. destroy(st_4)
  137. destroy(st_5)
  138. destroy(st_6)
  139. destroy(sle_user)
  140. destroy(sle_seria)
  141. destroy(sle_reg)
  142. destroy(cb_1)
  143. destroy(cb_2)
  144. destroy(cb_4)
  145. destroy(sle_ck)
  146. end on
  147. event open;string ls_rootpath = "c:"
  148. string ls_user
  149. string ls_volumename = "                                                                                                                                                                                                                                                                "
  150. ulong lul_serial
  151. ulong lul_complen
  152. ulong lul_flag
  153. ulong lul_volumenamesize = 256
  154. ulong lul_systemnamesize = 64
  155. string ls_filesystem = "                                                                "
  156. string ls_inifile
  157. string ls_reg_ini
  158. string ls_user_code
  159. string ls_seria_code
  160. string ls_reg_code
  161. string ls_seria
  162. string ls_ls_reg
  163. string ls_ok
  164. string ls_reg_code1
  165. long ll_pos
  166. long ll_and
  167. long ll_or
  168. long ll_ok
  169. long ll_count
  170. long ll_f
  171. boolean lb_if_reg = false
  172. string ls_seria_code2
  173. string ls_c
  174. string ls_check_code
  175. string ls_ck_code
  176. long ll_buf
  177. string disksn
  178. boolean lb_ret = false
  179. string ls_model
  180. string ls_user0
  181. string ls_subkeylist[]
  182. integer li_rtn
  183. integer li_rtn1
  184. long ll_s
  185. long ll_ln
  186. string ll_reg_name
  187. string ls_tem
  188. string ls_ctrl_code
  189. long loops
  190. string ls_s
  191. string ls_f
  192. long ll_start
  193. long ll_asc
  194. long lla_op[]
  195. long ll_l
  196. long ll_c
  197. string ls_node
  198. long ll_node
  199. long ll_max_node

  200. call super::open;
  201. f_convert_language(this)
  202. movewindcent(this)
  203. ll_buf = 50
  204. is_compname = space(ll_buf)
  205. getcomputernamea(is_compname,ll_buf)
  206. ls_model = space(100)
  207. disksn = space(100)
  208. lb_ret = diskid32(ls_model,disksn)
  209. if lb_ret then
  210. is_mess_info = is_mess_info + "disksn :" + disksn
  211. is_user = trim(disksn)
  212. for ll_f = 1 to len(is_user)
  213.   ls_c = mid(is_user,ll_f,1)
  214.   choose case asc(ls_c)
  215.    case ((45 , (48 to 57 )) or (65 to 90 )) or (97 to 122 )
  216.     exit
  217.    case else
  218.     is_user = ""
  219.   end choose
  220. next
  221. end if
  222. if (( not lb_ret) or isnull(is_user)) or trim(is_user) = "" then
  223. getvolumeinformationa(ls_rootpath,ls_volumename,lul_volumenamesize,lul_serial,lul_complen,lul_flag,ls_filesystem,lul_systemnamesize)
  224. is_user = string(lul_serial)
  225. is_mess_info = "lul_serial :" + string(lul_serial)
  226. end if
  227. if trim(is_user) = "" then
  228. is_user = "E0Lkj03"
  229. end if
  230. ls_user = gf_discidnum(is_user)
  231. if len(ls_user) > 8 then
  232. ls_user = left(ls_user,8)
  233. end if
  234. if isnumber(ls_user) = false then
  235. ls_user = "3503857"
  236. end if
  237. il_user = long(ls_user)
  238. is_mess_info = is_mess_info + ",il_user :" + string(il_user)
  239. sle_user.text = "DXDETS-" + is_user
  240. li_rtn1 = registrykeys("HKEY_LOCAL_MACHINE\Software\Star\reg",ls_subkeylist)
  241. if li_rtn1 = -1 then
  242. lb_if_reg = true
  243. else
  244. registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","user",regstring!,ls_user_code)
  245. registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","seria",regstring!,ls_seria_code)
  246. registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","register",regstring!,ls_reg_code)
  247. registryget("HKEY_LOCAL_MACHINE\Software\Star\reg","check_code",regstring!,ls_check_code)
  248. if isnull(ls_check_code) or ls_check_code = "" then
  249.   lb_if_reg = true
  250. else
  251.   ls_ck_code = ls_check_code
  252.   ls_check_code = gf_uotdense(ls_check_code)
  253.   if pos(ls_check_code,"X") = 0 then
  254.    lb_if_reg = true
  255.   else
  256.    ll_s = long(left(ls_check_code,pos(ls_check_code,"X") - 1))
  257.    ls_tem = mid(ls_check_code,pos(ls_check_code,"X") + 1)
  258.    if pos(ls_tem,"X") = 0 then
  259.     lb_if_reg = true
  260.    else
  261.     ll_ln = long(left(ls_tem,pos(ls_tem,"X") - 1))
  262.     ls_ctrl_code = mid(ls_tem,pos(ls_tem,"X") + 1)
  263.     ll_reg_name = mid(g_entity_name,ll_s,ll_ln)
  264.     ll_ln = len(ll_reg_name)
  265.     if ll_ln > 4 then
  266.      if mod(ll_ln,4) = 0 then
  267.       loops = ll_ln / 4
  268.      else
  269.       loops = ll_ln / 4 + 1
  270.      end if
  271.     else
  272.      loops = 1
  273.     end if
  274.     ls_s = ll_reg_name
  275.     ll_start = 1
  276.     ll_l = len(mid(ll_reg_name,ll_start))
  277.     do while ll_l <> 0
  278.      ls_f = mid(ll_reg_name,ll_start,loops)
  279.      ll_asc = 0
  280.      for ll_f = 1 to len(ls_f)
  281.       ll_asc = ll_asc + asc(mid(ls_f,ll_f,1))
  282.      next
  283.      lla_op[upperbound(lla_op) + 1] = ll_asc
  284.      ll_start = ll_start + loops
  285.      ll_l = len(mid(ll_reg_name,ll_start))
  286.     loop
  287.     select count ( *) from sys_register where user_code =' ' and seria_code =' ' and reg_code =' '  using sqlca;
  288. /* SQL Parameters List
  289. 0-> :ll_c
  290. 1-> :ls_user_code
  291. 2-> :ls_seria_code
  292. 3-> :ls_reg_code
  293. */
  294.     if isnull(ll_c) then
  295.      ll_c = 0
  296.     end if
  297.     ls_reg_code1 = gf_uotdense(ls_reg_code)
  298.     ls_seria_code2 = ls_seria_code
  299.     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
  300.      lb_if_reg = true
  301.     else
  302.      ls_user_code = mid(ls_user_code,8,len(ls_user_code) - 7)
  303.      ls_seria_code = mid(ls_seria_code,7)
  304.      if ls_user_code <> is_user then
  305.       lb_if_reg = true
  306.      else
  307.       if isnumber(ls_seria_code) = false then
  308.        lb_if_reg = true
  309.       else
  310.        ls_user_code = gf_discidnum(ls_user_code)
  311.        if len(ls_user_code) > 8 then
  312.         ls_user_code = left(ls_user_code,8)
  313.        end if
  314.        ll_and = inv_numberical.of_bitwiseand(long(ls_user_code),lla_op[1])
  315.        ll_or = inv_numberical.of_bitwiseor(long(ls_seria_code),lla_op[2])
  316.        ls_ok = string(ll_and) + string(ll_or)
  317.        ll_ok = long(ls_ok)
  318.        ll_and = inv_numberical.of_bitwiseand(ll_ok,lla_op[3])
  319.        ll_or = inv_numberical.of_bitwiseor(ll_ok,lla_op[4])
  320.        ls_ok = string(ll_and) + string(ll_or)
  321.        if ls_ok <> ls_reg_code1 then
  322.         lb_if_reg = true
  323.        else
  324.         if ll_c = 0 then
  325.          return
  326.         end if
  327.         sle_seria.text = ls_seria_code2
  328.         sle_reg.text = ls_reg_code
  329.         sle_ck.text = ls_ck_code
  330.         sle_seria.displayonly = true
  331.         sle_reg.displayonly = true
  332.         sle_ck.displayonly = true
  333.         cb_1.enabled = false
  334.         cb_2.text = "关闭(&C)"
  335.         SELECT CAST ( DECRYPT ( sysreg.node , '9U5WnZaY' ) AS CHAR ( 100 ) ) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' '  using sqlca;
  336. /* SQL Parameters List
  337. 0-> :ls_node
  338. 1-> :ls_seria_code2
  339. */
  340.         ll_node = long(ls_node)
  341.         select max ( max_node ) from sys_register  using sqlca;
  342. /* SQL Parameters List
  343. 0-> :ll_max_node
  344. */
  345.         if isnull(ll_max_node) then
  346.          ll_max_node = 0
  347.         end if
  348.         if ll_node > ll_max_node then
  349.          ll_max_node = ll_node
  350.         end if
  351.         if ll_max_node >= 50 then
  352.          st_7.text = f_get_text("不限点","!")
  353.         else
  354.          st_7.text = string(ll_max_node)
  355.         end if
  356.         return
  357.        end if
  358.       end if
  359.      end if
  360.     end if
  361.    end if
  362.   end if
  363. end if
  364. end if
  365. if lb_if_reg then
  366. if not f_check_reg(ls_seria_code2) then
  367. else
  368.   registrydelete("HKEY_LOCAL_MACHINE\Software\Star\reg","")
  369. end if
  370. end if
  371. return
  372. end event
  373. event key;graphicobject lgo_1

  374. call super::key;
  375. if key = keyenter! then
  376. lgo_1 = getfocus()
  377. if lgo_1 = sle_seria then
  378.   sle_reg.setfocus()
  379. end if
  380. if lgo_1 = sle_reg then
  381.   cb_1.setfocus()
  382. end if
  383. if lgo_1 = cb_1 then
  384.   cb_1.triggerevent(clicked!)
  385. end if
  386. end if
  387. return
  388. end event
  389. event pfc_preopen;call super::pfc_preopen;
  390. if gstr_oem.cotel <> "" then
  391. st_1.text = "咨询电话:" + gstr_oem.cotel
  392. else
  393. st_1.text = ""
  394. end if
  395. if gstr_oem.coemail <> "" then
  396. st_2.text = "电邮:" + gstr_oem.coemail
  397. else
  398. st_2.text = ""
  399. end if
  400. if gstr_oem.coaddr <> "" then
  401. st_3.text = "地址:" + gstr_oem.coaddr
  402. else
  403. st_3.text = ""
  404. end if
  405. end event
  406. type st_9 from statictext within w_register
  407. integer x = 462
  408. integer y = 376
  409. integer width = 439
  410. integer height = 68
  411. integer textsize = -9
  412. integer weight = 400
  413. fontcharset fontcharset
  414. fontpitch fontpitch
  415. string facename = "宋体"
  416. long textcolor = 33554432
  417. long backcolor = 12632256
  418. string text = "[color=Red]注册校验码[/color]:"
  419. alignment alignment
  420. boolean focusrectangle = false
  421. end type

  422. type st_8 from statictext within w_register
  423. integer x = 1458
  424. integer y = 160
  425. integer width = 123
  426. integer height = 56
  427. integer textsize = -9
  428. integer weight = 400
  429. fontcharset fontcharset
  430. fontpitch fontpitch
  431. string facename = "宋体"
  432. long textcolor = 16711680
  433. long backcolor = 12632256
  434. string text = "点数"
  435. boolean focusrectangle = false
  436. end type

  437. type st_7 from statictext within w_register
  438. integer x = 1577
  439. integer y = 160
  440. integer width = 206
  441. integer height = 56
  442. integer textsize = -9
  443. integer weight = 400
  444. fontcharset fontcharset
  445. fontpitch fontpitch
  446. string facename = "宋体"
  447. long textcolor = 16711680
  448. long backcolor = 12632256
  449. alignment alignment
  450. boolean focusrectangle = false
  451. end type

  452. type cb_3 from commandbutton within w_register
  453. integer x = 1778
  454. integer y = 36
  455. integer width = 238
  456. integer height = 84
  457. integer taborder = 10
  458. integer textsize = -9
  459. integer weight = 400
  460. fontcharset fontcharset
  461. fontpitch fontpitch
  462. string facename = "宋体"
  463. string text = "打印(&P)"
  464. end type

  465. event clicked;ulong li_job

  466. li_job = printopen("打印企业动力注册信息")
  467. print(li_job,"")
  468. print(li_job,"")
  469. print(li_job,500,"企业动力注册信息")
  470. print(li_job,1000,"公司名称:" + g_entity_name)
  471. print(li_job,1000,"注册电脑:" + parent.is_compname)
  472. print(li_job,1000,"用户序列号:" + parent.sle_user.text)
  473. print(li_job,1000,"授权序列号:" + parent.sle_seria.text)
  474. print(li_job,1000,"授权注册号:" + parent.sle_reg.text)
  475. print(li_job,1000,"注册校验码:" + parent.sle_ck.text)
  476. print(li_job,"")
  477. print(li_job,1000,"打印时间:" + string(today()) + " " + string(now()))
  478. printclose(li_job)
  479. return
  480. end event
  481. type dw_1 from datawindow within w_register
  482. boolean visible = false
  483. integer x = 197
  484. integer y = 824
  485. integer width = 686
  486. integer height = 400
  487. integer taborder = 60
  488. string title = "none"
  489. string dataobject = "d_sys_register"
  490. boolean livescroll = true
  491. borderstyle borderstyle
  492. end type

  493. event constructor;settransobject(sqlca)
  494. return
  495. end event
  496. type p_1 from picture within w_register
  497. integer width = 439
  498. integer height = 932
  499. boolean bringtotop = true
  500. string picturename = "bmp\reg.bmp"
  501. boolean border = true
  502. borderstyle borderstyle
  503. boolean focusrectangle = false
  504. end type

  505. type st_1 from statictext within w_register
  506. integer x = 453
  507. integer y = 660
  508. integer width = 1321
  509. integer height = 60
  510. boolean bringtotop = true
  511. integer textsize = -9
  512. integer weight = 400
  513. fontcharset fontcharset
  514. fontpitch fontpitch
  515. string facename = "宋体"
  516. boolean underline = true
  517. long textcolor = 16711680
  518. long backcolor = 12632256
  519. string text = "咨询电话:020-37604501,37604502,37604503"
  520. boolean focusrectangle = false
  521. end type

  522. type st_2 from statictext within w_register
  523. integer x = 453
  524. integer y = 716
  525. integer width = 1321
  526. integer height = 52
  527. boolean bringtotop = true
  528. integer textsize = -9
  529. integer weight = 400
  530. fontcharset fontcharset
  531. fontpitch fontpitch
  532. string facename = "宋体"
  533. boolean underline = true
  534. long textcolor = 16711680
  535. long backcolor = 12632256
  536. string text = "E_Mail:[email protected]"
  537. boolean focusrectangle = false
  538. end type

  539. type st_3 from statictext within w_register
  540. integer x = 453
  541. integer y = 780
  542. integer width = 1321
  543. integer height = 128
  544. boolean bringtotop = true
  545. integer textsize = -9
  546. integer weight = 400
  547. fontcharset fontcharset
  548. fontpitch fontpitch
  549. string facename = "宋体"
  550. boolean underline = true
  551. long textcolor = 16711680
  552. long backcolor = 12632256
  553. string text = "地址:广州市环市东路509号宝山大厦16楼"
  554. boolean focusrectangle = false
  555. end type

  556. type st_4 from statictext within w_register
  557. integer x = 462
  558. integer y = 172
  559. integer width = 439
  560. integer height = 60
  561. boolean bringtotop = true
  562. integer textsize = -9
  563. integer weight = 400
  564. fontcharset fontcharset
  565. fontpitch fontpitch
  566. string facename = "宋体"
  567. long textcolor = 33554432
  568. long backcolor = 12632256
  569. string text = "授权序列号:"
  570. alignment alignment
  571. boolean focusrectangle = false
  572. end type

  573. type st_5 from statictext within w_register
  574. integer x = 462
  575. integer y = 64
  576. integer width = 439
  577. integer height = 60
  578. boolean bringtotop = true
  579. integer textsize = -9
  580. integer weight = 400
  581. fontcharset fontcharset
  582. fontpitch fontpitch
  583. string facename = "宋体"
  584. long textcolor = 33554432
  585. long backcolor = 12632256
  586. string text = "用户序列号:"
  587. alignment alignment
  588. boolean focusrectangle = false
  589. end type

  590. type st_6 from statictext within w_register
  591. integer x = 462
  592. integer y = 272
  593. integer width = 439
  594. integer height = 60
  595. boolean bringtotop = true
  596. integer textsize = -9
  597. integer weight = 400
  598. fontcharset fontcharset
  599. fontpitch fontpitch
  600. string facename = "宋体"
  601. long textcolor = 33554432
  602. long backcolor = 12632256
  603. string text = "授权注册号:"
  604. alignment alignment
  605. boolean focusrectangle = false
  606. end type

  607. type sle_user from singlelineedit within w_register
  608. integer x = 896
  609. integer y = 40
  610. integer width = 864
  611. integer height = 84
  612. boolean bringtotop = true
  613. integer textsize = -9
  614. integer weight = 400
  615. fontcharset fontcharset
  616. fontpitch fontpitch
  617. string facename = "宋体"
  618. long textcolor = 16711680
  619. long backcolor = 12632256
  620. boolean autohscroll = false
  621. boolean displayonly = true
  622. borderstyle borderstyle
  623. end type

  624. type sle_seria from singlelineedit within w_register
  625. integer x = 896
  626. integer y = 148
  627. integer width = 558
  628. integer height = 84
  629. integer taborder = 20
  630. boolean bringtotop = true
  631. integer textsize = -9
  632. integer weight = 700
  633. fontcharset fontcharset
  634. fontpitch fontpitch
  635. string facename = "宋体"
  636. long textcolor = 33554432
  637. borderstyle borderstyle
  638. end type

  639. event modified;string ls_xh
  640. string ls_node
  641. integer li_node
  642. long ll_pos

  643. ls_xh = text
  644. SELECT CAST ( DECRYPT ( sysreg.node , '9U5WnZaY' ) AS CHAR ( 100 ) ) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' '  using sqlca;
  645. /* SQL Parameters List
  646. 0-> :ls_node
  647. 1-> :ls_xh
  648. */
  649. li_node = integer(ls_node)
  650. if sqlca.sqlcode <> 0 then
  651. messagebox(gs_meg_info,f_get_text("授权序列号错误!","!"))
  652. return
  653. end if
  654. if li_node >= 50 then
  655. parent.st_7.text = f_get_text("不限点","!")
  656. else
  657. parent.st_7.text = string(li_node)
  658. end if
  659. return
  660. end event
  661. type sle_reg from singlelineedit within w_register
  662. integer x = 896
  663. integer y = 256
  664. integer width = 864
  665. integer height = 84
  666. integer taborder = 40
  667. boolean bringtotop = true
  668. integer textsize = -9
  669. integer weight = 400
  670. fontcharset fontcharset
  671. fontpitch fontpitch
  672. string facename = "宋体"
  673. long textcolor = 33554432
  674. boolean autohscroll = false
  675. borderstyle borderstyle
  676. end type

  677. type cb_1 from commandbutton within w_register
  678. integer x = 896
  679. integer y = 460
  680. integer width = 864
  681. integer height = 84
  682. integer taborder = 50
  683. boolean bringtotop = true
  684. integer textsize = -9
  685. integer weight = 400
  686. fontcharset fontcharset
  687. fontpitch fontpitch
  688. string facename = "宋体"
  689. string text = "现在注册(&N)"
  690. end type

  691. event clicked;string ls_seria
  692. string ls_register
  693. string ls_ok
  694. string ls_register2
  695. string ls_seria2
  696. long ll_count
  697. long li_filenum
  698. long ll_and
  699. long ll_or
  700. long ll_seria
  701. long ll_ok
  702. string ls_seria_code
  703. string ls_user_code
  704. string ls_check_code
  705. long ll_pos
  706. long ll_pos2
  707. long ll_node
  708. long ll_no
  709. long ll_max_node
  710. long ll_add_node
  711. string ls_no
  712. string ls_mess
  713. long ll_s
  714. long ll_ln
  715. string ll_reg_name
  716. string ls_tem
  717. string ls_ctrl_code
  718. long loops
  719. string ls_s
  720. string ls_f
  721. long ll_start
  722. long ll_asc
  723. long lla_op[]
  724. long ll_l
  725. long ll_f
  726. string ls_node
  727. long ll_newrow
  728. long ll_found
  729. integer li_rtn

  730. ls_seria = trim(parent.sle_seria.text)
  731. ls_mess = "ls_seria:" + ls_seria + ", "
  732. if len(ls_seria) = 0 or isnull(ls_seria) then
  733. f_messagebox("提示","请输入授权序列号!",stopsign!,ok!,1)
  734. parent.sle_seria.setfocus()
  735. return
  736. end if
  737. ls_register2 = trim(parent.sle_reg.text)
  738. ls_mess = ls_mess + "ls_register2:" + ls_register2 + ", "
  739. ls_register = gf_uotdense(trim(parent.sle_reg.text))
  740. ls_mess = ls_mess + "ls_register:" + ls_register + ", "
  741. ls_check_code = trim(parent.sle_ck.text)
  742. if isnull(ls_check_code) or ls_check_code = "" then
  743. f_messagebox("提示","请输入注册校验码!",stopsign!,ok!,1)
  744. parent.sle_ck.setfocus()
  745. return
  746. end if
  747. ls_check_code = gf_uotdense(ls_check_code)
  748. if pos(ls_check_code,"X") = 0 then
  749. f_messagebox("校验码错误","请输入正确的注册校验码!",stopsign!,ok!,1)
  750. parent.sle_ck.setfocus()
  751. return
  752. end if
  753. ll_s = long(left(ls_check_code,pos(ls_check_code,"X") - 1))
  754. ls_tem = mid(ls_check_code,pos(ls_check_code,"X") + 1)
  755. if pos(ls_tem,"X") = 0 then
  756. f_messagebox("校验码错误","请输入正确的注册校验码!!",stopsign!,ok!,1)
  757. parent.sle_ck.setfocus()
  758. return
  759. end if
  760. ll_ln = long(left(ls_tem,pos(ls_tem,"X") - 1))
  761. ls_ctrl_code = mid(ls_tem,pos(ls_tem,"X") + 1)
  762. ll_reg_name = mid(g_entity_name,ll_s,ll_ln)
  763. ll_ln = len(ll_reg_name)
  764. if ll_ln > 4 then
  765. if mod(ll_ln,4) = 0 then
  766.   loops = ll_ln / 4
  767. else
  768.   loops = ll_ln / 4 + 1
  769. end if
  770. else
  771. loops = 1
  772. end if
  773. ls_s = ll_reg_name
  774. ll_start = 1
  775. ll_l = len(mid(ll_reg_name,ll_start))
  776. do while ll_l <> 0
  777. ls_f = mid(ll_reg_name,ll_start,loops)
  778. ll_asc = 0
  779. for ll_f = 1 to len(ls_f)
  780.   ll_asc = ll_asc + asc(mid(ls_f,ll_f,1))
  781. next
  782. lla_op[upperbound(lla_op) + 1] = ll_asc
  783. ll_start = ll_start + loops
  784. ll_l = len(mid(ll_reg_name,ll_start))
  785. loop
  786. if len(ls_register) = 0 or isnull(ls_register) then
  787. if not f_check_reg(ls_seria) then
  788. else
  789.   f_messagebox("提示","请输入授权注册号!",stopsign!,ok!,1)
  790.   parent.sle_reg.setfocus()
  791.   return
  792. end if
  793. end if
  794. ls_seria2 = ls_seria
  795. SELECT COUNT ( *) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' '  using sqlca;
  796. /* SQL Parameters List
  797. 0-> :ll_count
  798. 1-> :ls_seria2
  799. */
  800. if ll_count = 0 or isnull(ll_count) then
  801. f_messagebox("授权序列号错误","输入的授权序列号不正确,请输入正确的序列号!",stopsign!,ok!,1)
  802. ls_mess = ls_mess + "reg_code:" + ls_seria2 + f_get_text("(输入的授权序列号不正确), ","!")
  803. li_filenum = fileopen("regerror.txt",streammode!,write!,lockwrite!,append!)
  804. filewrite(li_filenum,ls_mess)
  805. fileclose(li_filenum)
  806. parent.sle_seria.setfocus()
  807. return
  808. end if
  809. SELECT CAST ( DECRYPT ( sysreg.node , '9U5WnZaY' ) AS CHAR ( 100 ) ) FROM sysreg WHERE CAST ( DECRYPT ( sysreg.reg_code , '9U5WnZaY' ) AS CHAR ( 100 ) ) =' '  using sqlca;
  810. /* SQL Parameters List
  811. 0-> :ls_node
  812. 1-> :ls_seria2
  813. */
  814. ll_node = long(ls_node)
  815. select max ( max_node ) from sys_register  using sqlca;
  816. /* SQL Parameters List
  817. 0-> :ll_max_node
  818. */
  819. if isnull(ll_max_node) then
  820. ll_max_node = 0
  821. end if
  822. if ll_node > ll_max_node then
  823. ll_max_node = ll_node
  824. end if
  825. if ll_max_node >= 50 then
  826. ll_max_node = 1000
  827. end if
  828. if not f_check_reg(ls_seria) then
  829. ll_max_node = 1000
  830. end if
  831. ll_add_node = f_get_reg_node(ls_seria)
  832. ls_seria_code = mid(ls_seria,7)
  833. ll_seria = long(ls_seria_code)
  834. ls_mess = ls_mess + "ll_seria:" + string(ll_seria) + ", "
  835. ls_mess = ls_mess + "il_user:" + string(parent.il_user) + ", "
  836. ll_and = parent.inv_numberical_reg.of_bitwiseand(parent.il_user,lla_op[1])
  837. ll_or = parent.inv_numberical_reg.of_bitwiseor(ll_seria,lla_op[2])
  838. ls_ok = string(ll_and) + string(ll_or)
  839. ll_ok = long(ls_ok)
  840. ll_and = parent.inv_numberical_reg.of_bitwiseand(ll_ok,lla_op[3])
  841. ll_or = parent.inv_numberical_reg.of_bitwiseor(ll_ok,lla_op[4])
  842. ls_ok = string(ll_and) + string(ll_or)
  843. ls_mess = ls_mess + "ls_ok:" + ls_ok + ", "
  844. if ls_register <> ls_ok then
  845. if not f_check_reg(ls_seria) then
  846. else
  847.   f_messagebox("提示:注册号错误","请输入正确的授权注册号!!",stopsign!,ok!,1)
  848.   ls_mess = ls_mess + "ls_register <> ls_ok time:" + string(today()) + string(now())
  849.   ls_mess = parent.is_mess_info + ";~t" + ls_mess + "######~t"
  850.   li_filenum = fileopen("regerror.txt",streammode!,write!,lockwrite!,append!)
  851.   filewrite(li_filenum,ls_mess)
  852.   fileclose(li_filenum)
  853.   parent.sle_reg.setfocus()
  854.   return
  855. end if
  856. end if
  857. ls_mess = ls_mess + "ls_register = ls_ok time:" + string(today()) + string(now())
  858. ls_mess = parent.is_mess_info + ";~t" + ls_mess + "######~t"
  859. li_filenum = fileopen("regerror.txt",streammode!,write!,lockwrite!,append!)
  860. filewrite(li_filenum,ls_mess)
  861. fileclose(li_filenum)
  862. ls_user_code = "DXDETS-" + parent.is_user
  863. parent.dw_1.retrieve()
  864. 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())
  865. if ll_found > 0 then
  866. parent.dw_1.object.computer[ll_found] = parent.is_compname
  867. parent.dw_1.object.user_code[ll_found] = ls_user_code
  868. parent.dw_1.object.seria_code[ll_found] = ls_seria
  869. parent.dw_1.object.reg_code[ll_found] = ls_register2
  870. else
  871. if parent.dw_1.rowcount() < ll_max_node + ll_add_node then
  872.   ll_newrow = parent.dw_1.insertrow(0)
  873.   ll_no = ll_newrow
  874.   ll_found = parent.dw_1.find("no >" + string(ll_no),1,parent.dw_1.rowcount())
  875.   do while ll_found > 0
  876.    ll_no = parent.dw_1.object.no[ll_found]
  877.    ll_found = parent.dw_1.find("no >" + string(ll_no),1,parent.dw_1.rowcount())
  878.   loop
  879.   if ll_no > ll_newrow then
  880.    ll_no ++
  881.   end if
  882.   parent.dw_1.object.no[ll_newrow] = ll_no
  883.   parent.dw_1.object.computer[ll_newrow] = parent.is_compname
  884.   parent.dw_1.object.user_code[ll_newrow] = ls_user_code
  885.   parent.dw_1.object.seria_code[ll_newrow] = ls_seria
  886.   parent.dw_1.object.reg_code[ll_newrow] = ls_register2
  887.   parent.dw_1.object.node[ll_newrow] = ll_newrow
  888.   parent.dw_1.object.max_node[ll_newrow] = ll_max_node
  889.   parent.dw_1.object.check_code[ll_newrow] = trim(parent.sle_ck.text)
  890. else
  891.   if f_messagebox(gs_meg_info,"注册节点数已经达到授权数,不能新增注册节点。~r~n如果要继续注册将会替代一个以前注册的节点,~r~n是否继续注册?",question!,yesno!,2) = 2 then
  892.    f_messagebox(gs_meg_info,"注册节点数已经达到授权数,注册尚未完成!",stopsign!,ok!,1)
  893.    return
  894.   end if
  895.   open(w_register_list)
  896.   ls_no = message.stringparm
  897.   if trim(ls_no) = "" or isnull(ls_no) or ( not isnumber(ls_no)) then
  898.    messagebox(gs_meg_info,"注册尚未完成!")
  899.    return
  900.   else
  901.    parent.dw_1.retrieve()
  902.    ll_found = parent.dw_1.find("no =" + ls_no,1,parent.dw_1.rowcount())
  903.    if ll_found < 1 then
  904.     f_messagebox(gs_meg_info,"发生错误,注册尚未完成!!",stopsign!,ok!,1)
  905.     return
  906.    end if
  907.    parent.dw_1.object.computer[ll_found] = parent.is_compname
  908.    parent.dw_1.object.user_code[ll_found] = ls_user_code
  909.    parent.dw_1.object.seria_code[ll_found] = ls_seria
  910.    parent.dw_1.object.reg_code[ll_found] = ls_register2
  911.    parent.dw_1.object.check_code[ll_found] = trim(parent.sle_ck.text)
  912.   end if
  913. end if
  914. end if
  915. for ll_f = 1 to parent.dw_1.rowcount()
  916. parent.dw_1.object.no[ll_f] = ll_f
  917. parent.dw_1.object.max_node[ll_f] = ll_max_node
  918. if parent.dw_1.object.node[ll_f] <> ll_f then
  919.   parent.dw_1.object.node[ll_f] = ll_f
  920. end if
  921. next
  922. if parent.dw_1.update() = -1 then
  923. rollback using sqlca;
  924. f_messagebox("提示","提交错误,注册失败!",stopsign!,ok!,1)
  925. return
  926. else
  927. registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","user",regstring!,"DXDETS-" + parent.is_user)
  928. registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","seria",regstring!,ls_seria)
  929. registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","check_code",regstring!,trim(parent.sle_ck.text))
  930. li_rtn = registryset("HKEY_LOCAL_MACHINE\Software\Star\reg","register",regstring!,ls_register2)
  931. if li_rtn = 1 then
  932.   commit using sqlca;
  933.   if ll_max_node >= 50 then
  934.    parent.st_7.text = f_get_text("不限点","!")
  935.   else
  936.    parent.st_7.text = string(ll_max_node)
  937.   end if
  938.   f_messagebox(gs_meg_info,"注册成功!",information!,ok!,1)
  939.   setnull(gl_expire_dates)
  940.   closewithreturn(parent,"1")
  941. else
  942.   rollback using sqlca;
  943.   f_messagebox("提示","写注册表失败,注册失败!",stopsign!,ok!,1)
  944. end if
  945. end if
  946. return
  947. end event
  948. type cb_2 from commandbutton within w_register
  949. integer x = 896
  950. integer y = 556
  951. integer width = 864
  952. integer height = 84
  953. integer taborder = 70
  954. boolean bringtotop = true
  955. integer textsize = -9
  956. integer weight = 400
  957. fontcharset fontcharset
  958. fontpitch fontpitch
  959. string facename = "宋体"
  960. string text = "以后注册(&L)"
  961. end type

  962. event clicked;closewithreturn(parent,"0")
  963. return
  964. end event
  965. type cb_4 from commandbutton within w_register
  966. integer x = 1778
  967. integer y = 144
  968. integer width = 238
  969. integer height = 84
  970. integer taborder = 30
  971. boolean bringtotop = true
  972. integer textsize = -9
  973. integer weight = 400
  974. fontcharset fontcharset
  975. fontpitch fontpitch
  976. string facename = "宋体"
  977. string text = "保存(&S)"
  978. end type

  979. event clicked;string docname
  980. string named
  981. integer value
  982. integer li_filenum

  983. value = getfilesavename("保存为",docname,named,"TXT","Text Files (*.TXT),*.TXT,Doc Files (*.DOC), *.DOC")
  984. changedirectory(gs_current_directory)
  985. if value = 1 then
  986. if fileexists(docname) then
  987.   filedelete(docname)
  988. end if
  989. li_filenum = fileopen(docname,linemode!,write!,lockwrite!,append!)
  990. filewrite(li_filenum,"企业动力注册信息")
  991. filewrite(li_filenum,"公司名称:" + g_entity_name)
  992. filewrite(li_filenum,"注册电脑:" + parent.is_compname)
  993. filewrite(li_filenum,"用户序列号:" + parent.sle_user.text)
  994. filewrite(li_filenum,"授权序列号:" + parent.sle_seria.text)
  995. filewrite(li_filenum,"授权注册号:" + parent.sle_reg.text)
  996. filewrite(li_filenum,"注册校验码:" + parent.sle_ck.text)
  997. fileclose(li_filenum)
  998. end if
  999. return
  1000. end event
  1001. type sle_ck from singlelineedit within w_register
  1002. integer x = 896
  1003. integer y = 360
  1004. integer width = 864
  1005. integer height = 84
  1006. integer taborder = 50
  1007. boolean bringtotop = true
  1008. integer textsize = -9
  1009. integer weight = 400
  1010. fontcharset fontcharset
  1011. fontpitch fontpitch
  1012. string facename = "宋体"
  1013. long textcolor = 33554432
  1014. borderstyle borderstyle
  1015. end type
复制代码
PYG19周年生日快乐!

该用户从未签到

 楼主| 发表于 2008-6-2 15:43:20 | 显示全部楼层
注册校验码


不知道哪来地
PYG19周年生日快乐!

该用户从未签到

 楼主| 发表于 2008-6-4 13:36:35 | 显示全部楼层
难道没人帮助一下嘛?
55555555555555555555555555
PYG19周年生日快乐!

该用户从未签到

发表于 2008-6-4 19:52:52 | 显示全部楼层
看不懂哦 什么意思啊???一头雾水
PYG19周年生日快乐!

该用户从未签到

 楼主| 发表于 2008-6-6 15:13:51 | 显示全部楼层
。。。

是我没说明白啊,郁闷……
PYG19周年生日快乐!
您需要登录后才可以回帖 登录 | 加入我们

本版积分规则

快速回复 返回顶部 返回列表