[已解决]:随机选择显示!!如何随机显示结果啊!!
本帖最后由 bj17209 于 2011-6-21 21:40 编辑#include <Array.au3>
InetGet("http://tv.tudou.com/albumtop/top/listRank.html?cid=30&type=0", @TempDir & "\2.html", 1)
$sString = FileRead(@TempDir & "\2.html")
$sRegExp = 'target="new">[^<]+</a></div></td>'
$asResult = StringRegExp($sString, $sRegExp, 3)
For $i = 0 To UBound($asResult) - 1 Step 1
$asResult[$i] = StringMid($asResult[$i], StringInStr($asResult[$i], '>') + 1, StringInStr($asResult[$i], '<') - StringInStr($asResult[$i], '>') - 1)
Next
_ArrayDisplay($asResult)
$randoms = Random(1, UBound($asResult), 1)
MsgBox(4096, "Program files are in:", $asResult[$randoms]) 我以前写的一个随机的例子你可以借鉴一下SRandom(@SEC/2)
Global $array
For $i=0 To 9
$array[$i]=$i
Next
For $i=10 To 35
$array[$i]=Chr(Asc("A")+$i-10)
Next
For $i=36 To 61
$array[$i]=Chr(Asc("a")+$i-36)
Next
$zhan=""
$mi=""
$mail="@163.com"
For $i=0 To Random(5,20,1)
$zhan=$zhan&$array
Next
For $i=0 To Random(5,11,1)
$mi=$mi&$array
Next
For $i=0 To Random(7,12,1)
$mail=$array&$mail
Next
Sen($zhan,$mi,$mail)
Sleep(1000*60)
WEnd
页:
[1]