|
|

分享源码
| 界面截图: |
- |
| 是否带模块: |
纯源码 |
| 备注说明: |
- |
| 变量名 | 类 型 | 静态 | 数组 | 备 注 | | objWbemLocator | 对象 | | | | objWMIService | 对象 | | | | colClasses | 对象 | | | | resultStr | 文本型 | | | | Str | 文本型 | | | | vIPAddresses | 变体型 | | | | i | 整数型 | | | | j | 整数型 | | |
如果真 (objWbemLocator. 创建 (“WbemScripting.SWbemLocator”, ) = 假) 返回 (“”)objWMIService = objWbemLocator.对象型方法 (“ConnectServer”, “.”, “root\cimv2”)resultStr = “[网卡]” + #换行符 colClasses = objWMIService. 对象型方法 (“ExecQuery”, “SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled='True'”) 变量循环首 (0, colClasses. 读数值属性 (“Count”, ) - 1, 1, i ) vIPAddresses = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “IPAddress”). 读属性 (“value”, ) Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “Description”). 读文本属性 (“value”, ) resultStr = resultStr + “描述=” + Str + #换行符  变量循环首 (0, vIPAddresses. 取数组成员数 () - 1, 1, j )  Str = vIPAddresses. 取文本 (j )  如果真 (Str ≠ “”)   Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “dnsHostName”). 读属性 (“value”, ). 取文本 (j )   resultStr = resultStr + “主机=” + Str + #换行符    Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “IPAddress”). 读属性 (“value”, ). 取文本 (j )   resultStr = resultStr + “地址=” + Str + #换行符    Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “IPSubnet”). 读属性 (“value”, ). 取文本 (j )   resultStr = resultStr + “子网=” + Str + #换行符    Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “DefaultIPGateway”). 读属性 (“value”, ). 取文本 (j )   resultStr = resultStr + “网关=” + Str + #换行符    Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “DNSServerSearchOrder”). 读属性 (“value”, ). 取文本 (j )   resultStr = resultStr + “DNS1=” + Str + #换行符    Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “DNSServerSearchOrder”). 读属性 (“value”, ). 取文本 (j + 1 )   resultStr = resultStr + “DNS2=” + Str + #换行符    Str = colClasses. 对象型方法 (“ItemIndex”, i ). 读对象型属性 (“Properties_”, ). 对象型方法 (“Item”, “MACAddress”). 读属性 (“value”, ). 取文本 (j )   resultStr = resultStr + “MAC=” + Str + #换行符     变量循环尾 () 变量循环尾 ()colClasses. 清除 ()objWMIService. 清除 ()objWbemLocator. 清除 ()返回 (resultStr )
|
-
|