找回密码
 加入
搜索
查看: 1967|回复: 1

[IE类操作] [已解决]:随机选择显示!!如何随机显示结果啊!!

[复制链接]
发表于 2011-6-21 21:16:08 | 显示全部楼层 |阅读模式
本帖最后由 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])
发表于 2011-6-21 21:27:10 | 显示全部楼层
我以前写的一个随机的例子你可以借鉴一下
SRandom(@SEC/2)
Global $array[26*2+10]
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[Random(0,61,1)]
        Next
        For $i=0 To Random(5,11,1)
                $mi=$mi&$array[Random(0,61,1)]
        Next
        For $i=0 To Random(7,12,1)
                $mail=$array[Random(0,61,1)]&$mail
        Next
        Sen($zhan,$mi,$mail)
        Sleep(1000*60)
        WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-10-2 01:40 , Processed in 0.073780 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表