- ;;Get MAC add.
- (defun GetNetMac (/id lox serv wmiobj)
- (setq WMIobj (vlax-create-object "wbemScripting.SwbemLocator")
- serv (vlax-invoke
- WMIobj 'ConnectServer "."
- "\\root\\cimv2" "" "" ""
- "" 128 nil
- )
- lox (vlax-invoke
- serv
- 'ExecQuery
- "SELECT * FROM Win32_NetworkAdapter"
- )
- )
- (vl-catch-all-apply
- (function
- (lambda ()
- (vlax-for item lox
- (if (and (setq name (vlax-get item "Manufacturer"))
- (not (wcmatch name "Microsoft*,VMware*"))
- (setq id (vlax-get item "MACAddress"))
- )
- (exit)
- )
- )
- )
- )
- )
- (mapcar 'vlax-release-object (list lox serv WMIobj))
- id
- )
- ;;Get NET Time
- (defun net_time (/ http date)
- (setq http (vla-GetInterfaceObject *acad* "Microsoft.XMLHTTP")
- )
- (vla-open http
- "Post"
- "http://fsxm.mjtd.com/datetime.php"
- :vlax-false
- );;
- (vlax-invoke-method http 'send);
- (while (/= (vlax-get-property http 'readystate) 4))
- (setq date (vlax-get-property http 'responsetext));
- (vlax-release-object http)
- (fx-replace (substr date 1 10) "-" "")
- )
- (defun fx-replace (str old new / len po start)
- (setq len (strlen new))
- (setq start 0)
- (while (setq po (vl-string-search old str start))
- (setq str (vl-string-subst new old str po))
- (setq start (+ po len))
- )
- str
- )
|