关于if的多次判断
本帖最后由 a000000 于 2009-7-13 15:05 编辑两个源码如下:
第一个:
#include <IE.au3>
$var = Ping("sdjt.vicp.net",250)
If $var Then; also possible: If @error = 0 Then ...
$oIE = _IECreate ("http://sdjt.vicp.net/")
Else
$oIE = _IECreate ("http://www.baidu.com/")
EndIf
第二个:
#include <IE.au3>
$verget = InetGet ( "http://sdjt.vicp.net/UploadFiles/20078716585531.jpg", @ScriptDir&"\20078716585531.jpg" , 1, 0)
if $vergetThen; also possible: If @error = 0 Then ...
$oIE = _IECreate ("http://sdjt.vicp.net/")
Else
$oIE = _IECreate ("http://www.baidu.com/")
EndIf
想把这连个合起来,做成一个:运行代码1,如果ping通则进入代码2,如果ping不同直接打开百度。搞了半下午没搞成,我是这样写的:
#include <IE.au3>
$var = Ping("sdjt.vicp.net",250)
$verget = InetGet ( "http://sdjt.vicp.net/UploadFiles/20078716585531.jpg", @ScriptDir&"\20078716585531.jpg" , 1, 0)
if $var Then; also possible: If @error = 0 Then ...
if $vergetThen; also possible: If @error = 0 Then ...
$oIE = _IECreate ("http://sdjt.vicp.net/")
Else
$oIE = _IECreate ("http://www.baidu.com/")
EndIf
Else
$oIE = _IECreate ("http://www.baidu.com/")
EndIf
求高手指点 沙发 我顶,这几天人越来越少 #include <IE.au3>
If Ping("sdjt.vicp.net",250) Or InetGet ( "http://sdjt.vicp.net/UploadFiles/20078716585531.jpg", @ScriptDir&"\20078716585531.jpg" , 1, 0) Then
$oIE = _IECreate ("http://sdjt.vicp.net/")
Else
$oIE = _IECreate ("http://www.baidu.com/")
EndIf别灌水浪费论坛资源!!! 本帖最后由 a000000 于 2009-7-13 14:25 编辑
#include
If Ping("sdjt.vicp.net",250) Or InetGet ( "http://sdjt.vicp.net/UploadFiles/20078716585531.jpg", @ScriptDir&"\20078716585531.jpg" , 1, 0) Then
$oIE = _IECreate ("http://sdjt.vicp.net/")
...
lynfr8 发表于 2009-7-13 14:17 http://www.autoitx.com/images/common/back.gif
帅哥,不行:运行代码1,如果ping通则进入代码2,如果ping不通直接打开百度
这个运行的结果不行 算了...........估计很难解决 按你说的意思,你自已的代码就是可以的,估计是你的问题没有表述清楚
页:
[1]