回复 1# 哈喽IT
有两个获取网络参数的函数,前一个" _ipconfig"适合XP系统,后一个" _ipconfig_"适合WIN7.Local $sText = _ipconfig_()
Local $sGateWay = '172.1.1.1'
If StringInStr($sText, $sGateWay) Then
MsgBox(0, 'msg', '区域符合,可以安装。')
Else
msgbox(16, 'msg','区域错误,无法安装!')
EndIf
Func _ipconfig()
Local $iPID, $sText = ''
$iPID = Run(@ComSpec & " /c ipconfig", '', @SW_HIDE, 6)
While 1
$sText &= StdoutRead($iPID)
If @error Then ExitLoop
WEnd
Return $sText
EndFunc
Func _ipconfig_()
Local $iPID, $sText = ''
$iPID = Run(@ComSpec & " /c ipconfig", '', @SW_HIDE, 6)
ProcessWaitClose($iPID)
$sText = StdoutRead($iPID)
Return $sText
EndFunc
|