Hi Alls,
I just create a code to blockade a user,if that user login with not same as my name,then user put code until 5 times,the program and I want blockade or Autocad exit,I knew this code should put in acaddoc.lsp or acad2005doc.lsp,but I still got problem how to count user login until 5 times in lisp program,anyone have time to look my code,and I very apreciated for your help,thanks.
Here Lsp file
(defun c:lnm (/ ans dcl_id nam)
(setq dcl_id (load_dialog "Login Name Manager.dcl"))
(if
(not (new_dialog "lnm" dcl_id))
(exit)
)
(set_tile "eb" "Abc")
(mode_tile "eb" 2)
(action_tile "eb" "(setq nam (get_tile \"eb\"))")
(action_tile "accept" "(done_dialog 1)")
(action_tile "cancel" "(done_dialog 0)(exit)")
(setq ans (start_dialog))
(if
nam
(progn
(if (= nam "")(c:lnm))
(if
(or (= nam "Adesu")(= nam "adesu"))
(progn
(alert (strcat "\nYou are right !!!"
"\n"
"\nMy name is "
"\n"
"\n" nam))
(exit)
) ; progn
) ; if
(if
(or (/= nam "Adesu")(/= nam "adesu"))
(c:lnm)
) ; if
) ; progn
(c:lnm)
) ; if
(princ)
) ; defun
here DCL file
// lnm is for Login Name Manager
lnm : dialog {label = "LOGIN NAME MANAGER";
: column {label = "Enter your name here";
: edit_box {key = "eb";}}
ok_cancel;}