4

我正在尝试为我正在编写的 Excel(适用于 Windows)应用程序提供一些基本级别的保护。我正在考虑使用机器的 mac 地址生成许可证文件。我的问题是:如何使用 VBScript 获取 Mac 地址?

4

1 回答 1

6
dim WMI:  set WMI = GetObject("winmgmts:\\.\root\cimv2")
dim Nads: set Nads = WMI.ExecQuery("Select * from Win32_NetworkAdapter where physicaladapter=true") 
dim nad
for each Nad in Nads
    if not isnull(Nad.MACAddress) then Wscript.Echo Nad.description, Nad.MACAddress   
next 

然而 MAC 可能是一个糟糕的选择。什么是唯一识别计算机的好方法?.

这将返回所有物理适配器,但对我来说,我也看到了Cisco Systems VPN Adapter for 64-bit Windows我不会将其描述为物理的适配器。

于 2013-05-10T16:43:26.773 回答