繁星
发表于 2017-6-14 19:55:27
支持一下~~
yuantian
发表于 2017-6-16 01:52:06
我电脑有一个情况就是这样,我有一个虚拟网卡,但是MAC地址是跟物理地址相同的,结果就导致了这个情况
图1、图2为软件检测网卡信息及MAC地址
图3、图4为已编译过的软件检测的信息
图5为 ipconfig命令检测的IP
请LZ看一下。
这是当时的代码片段:Func du()
If $pan = 1 Then
GUICtrlSetState($Group33, $GUI_FOCUS)
GUICtrlSetState($Group33, $gui_show)
$you = 0
$sComboRead = GUICtrlRead($Input7)
For $i = 0 To UBound($wangka1) - 1
For $o = 0 To UBound($mac) - 1
If $sComboRead == $wangka1[$i] Then
GUICtrlSetData($Label10, "" & $lianjie1[$i])
If StringTrimLeft($mac1[$i], 1) = "" Then
yin()
GUICtrlSetData($Label11, "" & StringTrimLeft($mac1[$i], 1))
GUICtrlSetData($xinxi, "当前网卡被禁用")
GUICtrlSetState($button1, $GUI_DISABLE)
GUICtrlSetState($button2, $GUI_DISABLE)
GUICtrlSetState($button3, $GUI_DISABLE)
GUICtrlSetState($button4, $GUI_DISABLE)
GUICtrlSetData($Group22, "当前计算机配置信息")
GUICtrlSetState($xinxi, $gui_show)
GUICtrlSetImage($ico, "", 2)
Else
GUICtrlSetState($button1, $GUI_ENABLE)
GUICtrlSetState($button2, $GUI_ENABLE)
GUICtrlSetState($button3, $GUI_ENABLE)
GUICtrlSetState($button4, $GUI_ENABLE)
GUICtrlSetState($xinxi, $gui_hide)
GUICtrlSetData($Label11, "" & StringTrimLeft($mac1[$i], 1))
xian()
EndIf
;MsgBox(0,0,UBound($mac))
;_ArrayDisplay($mac)
If $mac[$o] == StringTrimLeft($mac1[$i], 1) Then ;Exit ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
$dhcp = StringTrimLeft($dhcpserver[$o], 1)
If Not $dhcp = "" Then
GUICtrlSetData($Group22, "当前计算机配置信息 “DHCP” ")
Else
GUICtrlSetData($Group22, "当前计算机配置信息")
EndIf
;If $zhuangtai[$i] == "2" Then GUICtrlSetImage($ico, @TempDir & "\line.ico", 2)
If $zhuangtai[$i] == "7" Then
GUICtrlSetImage($ico, @TempDir & "\noline.ico", 2)
GUICtrlSetData($Input66, $computer)
_GUICtrlIpAddress_ClearAddress($Input11)
_GUICtrlIpAddress_ClearAddress($Input22)
_GUICtrlIpAddress_ClearAddress($Input33)
_GUICtrlIpAddress_ClearAddress($Input44)
_GUICtrlIpAddress_ClearAddress($Input55)
_GUICtrlIpAddress_Set($Input11, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[$i], "IPAddress"))
_GUICtrlIpAddress_Set($Input22, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[$i], "SubnetMask"))
_GUICtrlIpAddress_Set($Input33, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id[$i], "DefaultGateway"))
_GUICtrlIpAddress_Set($Input44, StringTrimLeft($DNS1[$o], 1))
_GUICtrlIpAddress_Set($Input55, StringTrimLeft($DNS2[$o], 1))
Else
GUICtrlSetImage($ico, @TempDir & "\line.ico", 2)
GUICtrlSetData($Input66, $computer)
_GUICtrlIpAddress_ClearAddress($Input11)
_GUICtrlIpAddress_ClearAddress($Input22)
_GUICtrlIpAddress_ClearAddress($Input33)
_GUICtrlIpAddress_ClearAddress($Input44)
_GUICtrlIpAddress_ClearAddress($Input55)
_GUICtrlIpAddress_Set($Input11, StringTrimLeft($IP[$o], 1))
_GUICtrlIpAddress_Set($Input22, StringTrimLeft($MAST[$o], 1))
_GUICtrlIpAddress_Set($Input33, StringTrimLeft($GATEWAY[$o], 1))
_GUICtrlIpAddress_Set($Input44, StringTrimLeft($DNS1[$o], 1))
_GUICtrlIpAddress_Set($Input55, StringTrimLeft($DNS2[$o], 1))
EndIf
EndIf
EndIf
Next
Next
ElseIf $pan = 0 Then
GUICtrlSetState($Group33, $GUI_FOCUS)
GUICtrlSetState($Group33, $gui_show)
$you = 0
;GUICtrlSetState($xinxi, $gui_hide)If StringTrimLeft($mac1[$i], 1) = "" Then
If StringTrimLeft($mac1, 1) = "" Then
yin()
;GUICtrlSetData($Label11, "" & StringTrimLeft($mac1, 1))
GUICtrlSetData($xinxi, "当前网卡被禁用")
GUICtrlSetState($button1, $GUI_DISABLE)
GUICtrlSetState($button2, $GUI_DISABLE)
GUICtrlSetState($button3, $GUI_DISABLE)
GUICtrlSetState($button4, $GUI_DISABLE)
GUICtrlSetData($Group22, "当前计算机配置信息")
GUICtrlSetState($xinxi, $gui_show)
GUICtrlSetImage($ico, "", 2)
Else
GUICtrlSetState($button1, $GUI_ENABLE)
GUICtrlSetState($button2, $GUI_ENABLE)
GUICtrlSetState($button3, $GUI_ENABLE)
GUICtrlSetState($button4, $GUI_ENABLE)
GUICtrlSetState($xinxi, $gui_hide)
GUICtrlSetData($Label11, "" & StringTrimLeft($mac1, 1))
xian()
GUICtrlSetData($Label10, "" & $lianjie1)
$dhcp = StringTrimLeft($dhcpserver, 1)
If Not $dhcp = "" Then
GUICtrlSetData($Group22, "当前计算机配置信息 “DHCP” ")
Else
GUICtrlSetData($Group22, "当前计算机配置信息")
EndIf
If $zhuangtai == "7" Then
GUICtrlSetImage($ico, @TempDir & "\noline.ico", 2)
GUICtrlSetData($Input66, $computer)
_GUICtrlIpAddress_ClearAddress($Input11)
_GUICtrlIpAddress_ClearAddress($Input22)
_GUICtrlIpAddress_ClearAddress($Input33)
_GUICtrlIpAddress_ClearAddress($Input44)
_GUICtrlIpAddress_ClearAddress($Input55)
_GUICtrlIpAddress_Set($Input11, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id, "IPAddress"))
_GUICtrlIpAddress_Set($Input22, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id, "SubnetMask"))
_GUICtrlIpAddress_Set($Input33, RegRead('HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Tcpip\Parameters\Interfaces\' & $id, "DefaultGateway"))
_GUICtrlIpAddress_Set($Input44, StringTrimLeft($DNS1, 1))
_GUICtrlIpAddress_Set($Input55, StringTrimLeft($DNS2, 1))
Else
GUICtrlSetImage($ico, @TempDir & "\line.ico", 2)
GUICtrlSetData($Input66, $computer)
_GUICtrlIpAddress_ClearAddress($Input11)
_GUICtrlIpAddress_ClearAddress($Input22)
_GUICtrlIpAddress_ClearAddress($Input33)
_GUICtrlIpAddress_ClearAddress($Input44)
_GUICtrlIpAddress_ClearAddress($Input55)
_GUICtrlIpAddress_Set($Input11, StringTrimLeft($IP, 1))
_GUICtrlIpAddress_Set($Input22, StringTrimLeft($MAST, 1))
_GUICtrlIpAddress_Set($Input33, StringTrimLeft($GATEWAY, 1))
_GUICtrlIpAddress_Set($Input44, StringTrimLeft($DNS1, 1))
_GUICtrlIpAddress_Set($Input55, StringTrimLeft($DNS2, 1))
EndIf
EndIf
Else
GUICtrlSetData($xinxi, "没有检测到网卡!")
GUICtrlSetData($Group22, "当前计算机配置信息")
GUICtrlSetState($xinxi, $gui_show)
GUICtrlSetState($button1, $GUI_DISABLE)
GUICtrlSetState($button2, $GUI_DISABLE)
GUICtrlSetState($button3, $GUI_DISABLE)
GUICtrlSetState($button4, $GUI_DISABLE)
EndIf
EndFunc ;==>du
xz00311
发表于 2017-6-18 17:27:03
正在找这样的程序,谢谢分享
dafahong
发表于 2017-6-22 00:34:40
不知道可有源码
dafahong
发表于 2017-6-22 01:13:03
回复 2# austere
dafahong
发表于 2017-6-22 01:13:36
回复能看到吗
cfengah
发表于 2017-6-22 01:32:08
回复 2# austere
闪过不停的 ,不能动
cfengah
发表于 2017-6-22 01:33:59
回复 1# austere
源码用什么版本编译
kkkpep
发表于 2017-6-25 12:34:14
很好,下载试试试试如何
austere
发表于 2017-6-27 11:22:18
回复 205# cfengah
3.12以上的版本均可
austere
发表于 2017-6-27 11:24:04
回复 199# yuantian
因为我是根据MAC地址来做判断的,如果两个MAC地址一样的话,那么判断条件就要修改一下
redapple2008
发表于 2017-6-27 11:24:51
其实这个想法不错,可以借鉴一下。
gaozhenghong
发表于 2017-7-4 08:46:35
正好需要,下载看一下
yuantian
发表于 2017-7-10 23:58:37
回复yuantian
因为我是根据MAC地址来做判断的,如果两个MAC地址一样的话,那么判断条件就要修改 ...
austere 发表于 2017-6-27 11:24 http://autoitx.com/images/common/back.gif
还有亲,你的这个代码还有另外的一个问题,就是在笔记本平台上,没有无线网卡,只有有线网卡的情况下,如果拔出有线网卡的网线,运行编译好的程序,会报错,Line多少多少ERROR的那种。。台式机平台下,没有问题。
canghaisui
发表于 2017-8-9 09:58:55
谢谢楼主分享