- 积分
- 26737
- 明经币
- 个
- 注册时间
- 2003-8-26
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
;;; ==============================================
;;; lsp注册模块
;;; 使用方法,将(jiany0001)插到你的程序中即可使用
;;; ==============================================
(defun jiany0001(/ bb dcl_re f fname fsys jqm n zcm)
(vl-load-com)
(defun jy (jqm) ; 算法:注册码=(机器码+144356842)^0.89取整,可自己修改
(itoa (fix (expt (+ (atoi jqm) 144356842) 0.89))))
(setq fsys (vlax-create-object "Scripting.FileSystemObject"))
(if (/= (vlax-invoke-method fsys "DriveExists" "C") :vlax-false)
(setq jqm (itoa (vlax-get-property (vlax-invoke-method fsys "GetDrive" "C") "SerialNumber"))))
(setq zcm (vl-registry-read "HKEY_CURRENT_USER\\Software\\TH++\\" "Number"))
(if (/= zcm (jy jqm))
(progn
(setq fname (vl-filename-mktemp "zhuc.dcl") f (open fname "w"))
(write-line "zhuc:dialog{ label=\"注册信息\";" f)
(write-line ":edit_box{label=\" 机器码\";key=\"e01\";edit_width=18;}" f)
(write-line ":edit_box{label=\" 授权码\";key=\"e02\";edit_width=18;}" f)
(write-line ":row{:button {label=\"注册\";key=\"e03\";is_default=true;}" f)
(write-line ":button {label=\"取消\";is_cancel=true;}}}" f)
(close f)
(new_dialog "zhuc" (setq dcl_re (load_dialog fname)))
(set_tile "e01" jqm)
(set_tile "e02" "联系QQ:XXXXXX")
(action_tile "e03" "(setq zcm (get_tile \"e02\")) (done_dialog 1)")
(if (= (start_dialog) 1)(vl-registry-write "HKEY_CURRENT_USER\\software\\TH++\\" "Number" zcm))
(unload_dialog dcl_re)
(vl-file-delete fname)
(if (/= zcm (jy jqm))
(progn (alert "注册失败!") (exit))
(alert "注册成功!"))))
(princ)
)
;;; =====================================
;;; 配套的注册机程序
;;; =====================================
(defun c:zhuc (/ dcl_re f fname jqm)
(vl-load-com)
(defun jy (jqm) ; 算法:注册码=(机器码+144356842)^0.89取整
(itoa (fix (expt (+ (atoi jqm) 144356842) 0.89))))
(setq fname (vl-filename-mktemp "zhuc.dcl")f (open fname "w"))
(write-line "zhuc:dialog{ label=\"注册机\";" f)
(write-line ":edit_box{label=\" 机器码\";key=\"e01\";edit_width=18;}" f)
(write-line ":edit_box{label=\" 授权码\";key=\"e02\";edit_width=18;}" f)
(write-line ":row{:button {label=\"计算\";key=\"e03\";is_default=true;}" f)
(write-line ":button {label=\"取消\";is_cancel=true;}}}" f)
(close f)
(new_dialog "zhuc" (setq dcl_re (load_dialog fname)))
(action_tile "e03" "(setq jqm (get_tile \"e01\")) (set_tile \"e02\" (jy jqm))")
(start_dialog)
(unload_dialog dcl_re)
(vl-file-delete fname)
(princ)
)
|
评分
-
查看全部评分
|