文档库

最新最全的文档下载
当前位置:文档库 > LISP加密

LISP加密

(defun UseLimit (/ FIND_SERIALNUMBER regNumber num regnum reg_path *error*)
(defun *error* (msg / ent count)
(princ)
)
(defun FIND_SERIALNUMBER (DRIVE / FILSYS VAL)
(setq FILSYS (vlax-create-object "Scripting.FileSystemObject"))
;;(vlax-dump-object FILSYS t)
(setq VAL (vlax-invoke FILSYS "GetDrive" DRIVE))
;;(vlax-dump-object VAL t)
(setq VAL (vl-catch-all-apply
'vlax-get
(list VAL "SerialNumber")
)
)
(vlax-release-object FILSYS)
(if (vl-catch-all-error-p VAL)
(setq VAL NIL)
VAL
)
)

(setq reg_path "HKEY_CURRENT_USER\\Software\\VB and VBA Program Settings\\temp")
(setq regNumber (vl-registry-read reg_path "注册码"))
(if (/= regNumber
(itoa
(/ (atoi (rtos (atoi (rtos (FIND_SERIALNUMBER "C:"))))) 2);;;注册码=申请码/2
)
)
(progn
(alert
(strcat
"请注册!")
)
(setq num (rtos (FIND_SERIALNUMBER "C:")))
(setq regnum (itoa (/ (atoi (rtos (atoi num))) 2)));;;注册码=申请码/2
(textscr)
(princ
(strcat "您的申请码为: " num)
)
(setq regNumber (getstring "\n请输入注册码:"))
(if (/= regNumber regnum)
(progn
(alert "注册码无效!")
(exit)
)
(progn
(vl-registry-write reg_path "注册码" regnum)
(alert "您已成功注册!")
)
)
T
)
)
(princ)
)