本帖最后由 highflybir 于 2013-1-4 11:23 编辑
Nico 发表于 2013-1-4 11:06
w7 如何搞
- (defun C:MAC (/ WMI SVR MAC S STR)
- (vl-load-com)
- (setq WMI (vlax-create-object "WbemScripting.SWbemLocator"))
- (setq SVR (vlax-invoke WMI 'ConnectServer))
- (setq str "Select * from Win32_NetworkAdapterConfiguration Where IPEnabled=TRUE")
- (setq MAC (vlax-invoke SVR 'ExecQuery str))
- (vlax-for i MAC
- (setq S (cons (vlax-get i 'MACAddress) S))
- )
- (vlax-release-object MAC)
- (vlax-release-object SVR)
- (vlax-release-object WMI)
- (princ s)
- (princ)
- )
|