|
我想获取电脑网卡的信息代码如下:
GUICtrlSetData($bjxx_pc_nae, "计算机名称 : " & @ComputerName)
GUICtrlSetData($bjxx_ip, "本 机 IP : " & @IPAddress1)
GUICtrlSetData($bjxx_ym, "子网掩码 : ")
GUICtrlSetData($bjxx_wg, "默 认 网 关 :" & _Gateway())
Func _Gateway()
Dim $IPGateway
Dim $objWMIService = ObjGet("winmgmts:\\.\root\CIMV2")
Dim $colItems = $objWMIService.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = TRUE", "WQL", 0x10 + 0x20)
For $objItem In $colItems
$IPGateway = $objItem.DefaultIPGateway(0)
If StringInStr($IPGateway, ".") > 0 Then ExitLoop
Next
Return StringRegExpReplace($IPGateway, '(\d+\.){12}', '')
EndFunc ;==>_Gateway
GUICtrlSetData($bjxx_mac_address, "本 机 MAC : " & _API_Get_NetworkAdapterMAC(@IPAddress1))
GUICtrlSetData($bjxx_pub_ip, "公网IP地址: " & _qqip())
Func _qqip()
Local $source = _INetGetSource("http://ip.qq.com")
Local $aIP = StringRegExp($source, '您当前的IP为.*?(\d[\d.]+)', 3, 1)
If Not @error Then
Return $aIP[0]
Else
Return 0
EndIf
EndFunc ;==>_qqip
GUICtrlSetData($bjxx_info_get_time, "当前时间:" & @YEAR & "-" & @MON & "-" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC)
有哪位大神 可以指导下 那个子网掩码 怎么写哦,跪谢 |
|