C creation-zy Unregistered / Unconfirmed GUEST, unregistred user! 2006-08-30 #2 下面是用VBScript操纵WMI对象提取网卡信息的代码,稍加修改就能达到您的目的。<br><br>Set objWMILocator = CreateObject("WbemScripting.SWbemLocator"<br>Set objWMIService = objWMILocator.ConnectServer<br>On Error Resume Next<br>Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=true",,48)<br>N=1<br>For Each objItem in colItems<br> WITH objItem<br> if .MACAddress<>"" then<br> Call WriteIndexValue("NetworkCard",N,.Description)<br> Call WriteIndexValue("MAC",N,Replace(CStr(.MACAddress),":","-")<br> Call WriteIndexValue("IP",N,.IPAddress(0))<br> N=N+1<br> end if<br> END WITH<br>Next<br>'WriteIndexValue 是一个输出函数,可以自行实现
下面是用VBScript操纵WMI对象提取网卡信息的代码,稍加修改就能达到您的目的。<br><br>Set objWMILocator = CreateObject("WbemScripting.SWbemLocator"<br>Set objWMIService = objWMILocator.ConnectServer<br>On Error Resume Next<br>Set colItems = objWMIService.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=true",,48)<br>N=1<br>For Each objItem in colItems<br> WITH objItem<br> if .MACAddress<>"" then<br> Call WriteIndexValue("NetworkCard",N,.Description)<br> Call WriteIndexValue("MAC",N,Replace(CStr(.MACAddress),":","-")<br> Call WriteIndexValue("IP",N,.IPAddress(0))<br> N=N+1<br> end if<br> END WITH<br>Next<br>'WriteIndexValue 是一个输出函数,可以自行实现