网页打不开跳转问题
本帖最后由 yjiawfn 于 2011-3-6 13:14 编辑While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Xinzhengdongzhan
_IENavigate($oIE, "http://218.29.*.114:8081/")
判断网页是否能打开,打不开就打开其他网址
Case $msg = $GUI_Button_Naiguan
_IENavigate($oIE, "http://218.29.*.14:8082/")
判断网页是否能打开,打不开就打开其他网址
Case $msg = $GUI_Button_Mazhai
_IENavigate($oIE, "http://218.29.*.114:8083/")
判断网页是否能打开,打不开就打开其他网址
Case $msg = $GUI_Button_Bangong
_IENavigate($oIE, "http://218.29.*.114:8084/")
判断网页是否能打开,打不开就打开其他网址
Case $msg = $GUI_Button_Zhuangchezhan
_IENavigate($oIE, "http://218.29.*.114:8085/")
判断网页是否能打开,打不开就打开其他网址
EndSelect
WEnd
里面还没有写入跳转代码,因为自己不太懂.不会代码就用中文代替,希望得到答案.谢谢 _IENavigate是不是不能判读返回值啊
如果用_IECreate该怎么写 While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
ExitLoop
Case $msg = $GUI_Button_Xinzhengdongzhan
$some = _IECreate("http://217.00.00.14:8081", 0, 0)
$sText = _IEBodyReadText($some)
If StringInStr($sText, "无法显示网页") Then
_IENavigate($oIE, "http://192.168.1.150:8081/")
Else
_IENavigate($oIE, "http://217.00.00.14:8081/")
EndIf
Case $msg = $GUI_Button_Naiguan
$some = _IECreate("http://217.00.00.14:8081", 0, 0)
$sText = _IEBodyReadText($some)
If StringInStr($sText, "无法显示网页") Then
_IENavigate($oIE, "http://192.168.1.151:8082/")
Else
_IENavigate($oIE, "http://217.00.00.14:8082/")
EndIf
Case $msg = $GUI_Button_Mazhai
$some = _IECreate("http://217.00.00.14:8081", 0, 0)
$sText = _IEBodyReadText($some)
If StringInStr($sText, "无法显示网页") Then
_IENavigate($oIE, "http://192.168.1.152:8083/")
Else
_IENavigate($oIE, "http://217.00.00.14:8083/")
EndIf
Case $msg = $GUI_Button_Bangong
$some = _IECreate("http://217.00.00.14:8081", 0, 0)
$sText = _IEBodyReadText($some)
If StringInStr($sText, "无法显示网页") Then
_IENavigate($oIE, "http://192.168.1.153:8084/")
Else
_IENavigate($oIE, "http://217.00.00.14:8084/")
EndIf
Case $msg = $GUI_Button_Zhuangchezhan
$some = _IECreate("http://217.00.00.14:8081", 0, 0)
$sText = _IEBodyReadText($some)
If StringInStr($sText, "无法显示网页") Then
_IENavigate($oIE, "http://192.168.1.154:8085/")
Else
_IENavigate($oIE, "http://217.00.00.14:8085/")
EndIf
EndSelect
WEnd
自己是这样写的,内网测试通过,明天测试下外网看行不
大侠帮帮忙看看,是不是有更简单的方法
页:
[1]