求助:如何提高在线校验 NOD32 ID 速度
本帖最后由 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[$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] = $a_Id[$i]
$a_IdInfo[$p] = $a_Id[$i + 1]
If StringInStr($a_Id[$i], "EAV-") Then
$a_IdInfo[$p] = $a_Time
Else
$a_IdInfo[$p] = $a_Time
EndIf
$p += 1
EndIf
Next
_ArrayDisplay($a_IdInfo, "$a_IdInfo")
;-------------------------验校ID的有效性---------------------------
Local $N = 4
Local $a_Final_Id[$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] & " | " & $a_IdInfo[$i])
Local $ID = $a_IdInfo[$i] & ":" & $a_IdInfo[$i]
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] = $a_IdInfo[$i]
$a_Final_Id[$p] = $a_IdInfo[$i]
$a_Final_Id[$p] = $a_IdInfo[$i]
If $Ess_Size > 100 And _
$Eav_Size > 100 Then
$a_Final_Id[$p] = "ESS/EAV"
ElseIf $Eav_Size > 100 Then
$a_Final_Id[$p] = "EAV"
ElseIf $Ess_Size > 100 Then
$a_Final_Id[$p] = "ESS"
EndIf
EndIf
$p += 1
Next
ProgressOff()
_ArrayDisplay($a_Final_Id, "$a_Final_Id")
页:
[1]