本帖最后由 lsszmj 于 2012-2-11 15:04 编辑
怎样加快验校进度,谢谢.代码如下:#include <INet.au3>
#include <Array.au3>
Opt("MustDeclareVars", 1)
;------------------脚本开始-------------------------
Local $a_Url = "http://www.zolsky.com/" & _
"killsoftware/sdsoft/NOD32/nod32_id.htm"
Local $HTMLSource = _INetGetSource($a_Url)
Local $N = 3
Local $a_IdInfo[1][$N], $p = 1
Local $a_Id = StringRegExp($HTMLSource, _
"名:\s*(.+?)\s*<[\s\S]+?:\h*(.+?)\h*<", 3)
Local $a_Time = StringRegExp($HTMLSource, _
"至:(\d*.{6})", 3)
;_ArrayDisplay($a_Id, "$a_Id")
;_ArrayDisplay($a_Time, "$a_Time")
For $i = 0 To UBound($a_Id) - 1 Step 2
If $a_Id[$i] <> "" Then
ReDim $a_IdInfo[$p + 1][$N]
$a_IdInfo[$p][0] = $a_Id[$i]
$a_IdInfo[$p][1] = $a_Id[$i + 1]
If StringInStr($a_Id[$i], "EAV-") Then
$a_IdInfo[$p][2] = $a_Time[1]
Else
$a_IdInfo[$p][2] = $a_Time[0]
EndIf
$p += 1
EndIf
Next
_ArrayDisplay($a_IdInfo, "$a_IdInfo")
;-------------------------验校ID的有效性---------------------------
Local $N = 4
Local $a_Final_Id[1][$N], $p = 1
For $i = 1 To UBound($a_IdInfo) - 1
ProgressOn("共有" & UBound($a_IdInfo) - 1 & "个ID,第" & _
$i & "个验校中!", "正在验校ID的有效性,请稍候……")
ProgressSet($i / UBound($a_IdInfo) * 100, " 正在验证 " & _
$a_IdInfo[$i][0] & " | " & $a_IdInfo[$i][1])
Local $ID = $a_IdInfo[$i][0] & ":" & $a_IdInfo[$i][1]
Local $Ess_Size = InetGetSize("http://" & $ID & "@" & _
"download.eset.com/download/win/v4ess/ess_nt32_enu.msi")
Local $Eav_Size = InetGetSize("http://" & $ID & "@" & _
"download.eset.com/download/win/v4eav/eav_nt32_enu.msi")
If $Ess_Size > 100 Or $Eav_Size > 100 Then
ReDim $a_Final_Id[$p + 1][$N]
$a_Final_Id[$p][0] = $a_IdInfo[$i][0]
$a_Final_Id[$p][1] = $a_IdInfo[$i][1]
$a_Final_Id[$p][2] = $a_IdInfo[$i][2]
If $Ess_Size > 100 And _
$Eav_Size > 100 Then
$a_Final_Id[$p][3] = "ESS/EAV"
ElseIf $Eav_Size > 100 Then
$a_Final_Id[$p][3] = "EAV"
ElseIf $Ess_Size > 100 Then
$a_Final_Id[$p][3] = "ESS"
EndIf
EndIf
$p += 1
Next
ProgressOff()
_ArrayDisplay($a_Final_Id, "$a_Final_Id")
|