#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
#include <inet.au3>
#include <Misc.au3>
#include <file.au3>
;#include <date.au3>
Opt("TrayIconHide", 1)
If _Singleton(@ScriptName, 1) = 0 Then
MsgBox(64, "警告", "您只能运行一个此应用程序!")
Exit (1)
EndIf
$Form1 = GUICreate("360MobileNumber", 1300, 680, -1, -1)
$oIE = _IECreateEmbedded()
$GUIActiveX = GUICtrlCreateObj($oIE, -1, -1, 1300, 600)
$oButton = GUICtrlCreateButton("开始", 600, 630, 100, 36)
GUICtrlSetFont(-1, 12, 400, 0, "微软雅黑")
GUICtrlSetColor(-1, 0x008B00)
GUISetBkColor(0xCCCCFF)
$label = GUICtrlCreateLabel("", 10, 640, 80, 25)
GUISetState(@SW_SHOW)
_IENavigate($oIE, "http://test", 0)
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case -3
Exit
Case $oButton
_IENavigate($oIE,'about:blank',0)
Local $aRecords
_FileReadToArray(@ScriptDir & "\Temp\MobileArea.txt", $aRecords)
;Local $file = FileOpen(@ScriptDir & "\Result\FirstRound.txt", 258)
Local $sData[]
;Local $x = 0
;Local $time = _NowCalc()
For $i = 1 To $aRecords[0]
Local $start = $aRecords[$i] * 10000
Local $end = $aRecords[$i] * 10000 + 9999
DirCreate(@ScriptDir & "\Temp" & $aRecords[$i])
For $n = $start To $end
Local $Onestop = 0
For $x = 1 To 100
$sData[$x] = InetGet("http://test/mod/mobileValid/checkMobile/phone/" & $start, @ScriptDir & "\Temp" & $aRecords[$i] & "" & $start & ".txt", 1, 1)
$start += 1
$Onestop = $x
If $start > $end Then ExitLoop
Next
Local $comPlete = 0
While 1
Sleep(100)
For $x = 1 To $Onestop
If InetGetInfo($sData[$x], 2) Then
$comPlete = 1
Else
$comPlete = 0
ExitLoop
EndIf
Next
If $comPlete = 1 Then
GUICtrlSetData($label,$start)
For $x = 1 To $Onestop
InetClose($sData[$x])
Next
ExitLoop
EndIf
WEnd
If Mod($start, 1000) == 0 Then _ReduceMemory(@AutoItPID)
If $start > $end Then ExitLoop
Next
Next
;MsgBox(0,0,_DateDiff("s", $time, _NowCalc()))
;FileClose($file)
EndSwitch
WEnd
Func _ReduceMemory($i_PID = -1)
If $i_PID <> -1 Then
Local $ai_Handle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', 0x1f0fff, 'int', False, 'int', $i_PID)
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', $ai_Handle[0])
DllCall('kernel32.dll', 'int', 'CloseHandle', 'int', $ai_Handle[0])
Else
Local $ai_Return = DllCall("psapi.dll", 'int', 'EmptyWorkingSet', 'long', -1)
EndIf
Return $ai_Return[0]
EndFunc ;==>_ReduceMemory