可以透過VLISP呼叫WINDOWS的API函式獲得,例如以下程式(獲取硬碟的序列號):
(DEFUN PHYHAR (/ RET SERX OBJW LCCON LOX)
(VL-LOAD-COM)
(SETQ SERX "())
(IF (SETQ OBJW (VLAX-CREATE-OBJECT "wbemScripting.SwbemLocator"))
(PROGN
(SETQ LCCON (VLAX-INVOKE OBJW "CONNECTSERVER "." "\\root\\cimv2" "" ""
"" "" 128 NIL
)
(SETQ LOX (VLAX-INVOKE LCCON "EXECQUERY "Select SerialNumber,Tag from Win32_PhysicalMedia"))
(VLAX-FOR ITEM LOX (SETQ SERX (CONS (LIST (VLAX-GET ITEM "TAG)
(VLAX-GET ITEM "SERIALNUMBER)
) SERX
(VLAX-RELEASE-OBJECT LOX)
(VLAX-RELEASE-OBJECT LCCON)
(VLAX-RELEASE-OBJECT OBJW)
(PRINC (REVERSE SERX))
(PRINC)
可以透過VLISP呼叫WINDOWS的API函式獲得,例如以下程式(獲取硬碟的序列號):
(DEFUN PHYHAR (/ RET SERX OBJW LCCON LOX)
(VL-LOAD-COM)
(SETQ SERX "())
(IF (SETQ OBJW (VLAX-CREATE-OBJECT "wbemScripting.SwbemLocator"))
(PROGN
(SETQ LCCON (VLAX-INVOKE OBJW "CONNECTSERVER "." "\\root\\cimv2" "" ""
"" "" 128 NIL
)
)
(SETQ LOX (VLAX-INVOKE LCCON "EXECQUERY "Select SerialNumber,Tag from Win32_PhysicalMedia"))
(VLAX-FOR ITEM LOX (SETQ SERX (CONS (LIST (VLAX-GET ITEM "TAG)
(VLAX-GET ITEM "SERIALNUMBER)
) SERX
)
)
)
(VLAX-RELEASE-OBJECT LOX)
(VLAX-RELEASE-OBJECT LCCON)
(VLAX-RELEASE-OBJECT OBJW)
)
)
(PRINC (REVERSE SERX))
(PRINC)
)