我又有个问题请教大侠们,如下网上下的试用 程序如何用? ;;;Copyrignt chengqiang Lin 2008 for mengyang ;;;为梦扬软件添加使用期限 (defun my_a_date () (setq mengyang_code_e (vl-registry-read "HKEY_CURRENT_USER\\Software\\MengYang" "my_code_date_start" ) );读出首次安装梦扬软件的日期 (if (/= mengyang_code_e nil) (progn (setq mengyang_code_e (vl-registry-read "HKEY_CURRENT_USER\\Software\\MengYang" "my_code_date_start" ) );如果已经安装梦扬则读出首次安装梦扬软件的日期 (setq OLD_x (atof mengyang_code_e)) (setq OLD (substr mengyang_code_e 3 2)) (setq OLD_1 (atof OLD)) (setq OLD_2 (- 30 OLD_1)) (setq OLD_3 (- (+ (+ 30 OLD_x) 100) (+ OLD_1 OLD_2)));;;+30天试用 (setq date_d_e (getvar "cdate"));;;获取当前日期 (setq date_d_1_e (rtos date_d_e 2 20)) (setq date_d_2_e (substr date_d_1_e 5 4)) (setq date_d_3_e (atof date_d_2_e)) (setq my_da (- OLD_3 date_d_3_e)) (if (> my_da 30.0)(setq my_da (- 30 (- 100 My_da)))(princ)) (if (> my_da 30.0)(vl-registry-delete "HKEY_CURRENT_USER\\Software\\MengYang" "code")(princ)) ;;剩余的使用日期 (setq LP1 "\n-->距你使用梦扬软件的最后期限还剩") (setq LP3 "天!") (setq LP2 (rtos my_da)) (setq Princ_LP (strcat LP1 LP2 LP3)) (cond ((<= my_da 0)(alert "\n梦扬软件已经到了使用期限,请你重新注册!")(vl-registry-delete "HKEY_CURRENT_USER\\Software\\MengYang" "code")) ((<= my_da 30)(prompt Princ_LP)) ((> my_da 30)(alert "\n梦扬软件已经到了使用期限,请你重新注册!")(vl-registry-delete "HKEY_CURRENT_USER\\Software\\MengYang" "code")) ) ) (princ) ) )
是直加入我们LSP文件里?还是另存个文件来运行?以下有个程序(注:也是网络上下的)如何加入使用以上程序,请高手指导,谢谢! ( defun c:zx() (prompt "欢迎您用此程序") (setvar "cmdecho" 0) ;创建新层 (setq oldvar (getvar "OSMODE")) (setvar "OSMODE" 512) (command "pline") (while (= 1 1) (setq p1 (getpoint "\n请选择第一个点:")) (setq firstX (car p1)) (setq firstY (cadr p1)) (setq p2 (getpoint "\n请选择第二个点:")) (if p2 (progn (setq secondX (car p2)) (setq secondY (cadr p2)) (setq mX (/ (+ firstX secondX) 2)) (setq mY (/ (+ firstY secondY) 2)) (setq mX (rtos mX)) (setq mY (rtos mY)) (command (strcat mX "," mY)) ) (progn (command "") ) ) ) (setvar "OSMODE" oldvar) (princ) ) 我很菜,只有通过不断学习才会进步,希望有好心的高手指导指导,谢谢! |