首页 > 代码库 > AutoIT 实现Firefox下载

AutoIT 实现Firefox下载

Firefox下载的完整代码:

Func IsVisible($handle)	;WinGetState:  2 = Window is visible	If BitAND(WinGetState($handle), 2) Then		Return 1	Else		Return 0	EndIfEndFunc   ;==>IsVisible;firefox下载Func _DownloadFile()    AutoItSetOption("WinTitleMatchMode", 2);    WinWaitActive("正在打开 test.zip","", 15);		If WinActivate("正在打开 test.zip", "") Then		Local $handle = WinGetHandle("正在打开 test.zip")		Send("!s")		Send("{enter}")		WinWaitActive("输入要保存的文件名…","")		If(WinActivate("输入要保存的文件名…","")) Then			ControlSetText("", "", "[CLASS:Edit; INSTANCE:1]", "D:\auto.zip")			ControlClick("", "","[CLASS:Button; TEXT:保存(&S)]")						;Returns an array of matching window titles and handles.			Local $var = WinList()			For $i = 1 To $var[0][0]			; Only display visble windows that have a title				If $var[$i][0] <> "" And IsVisible($var[$i][1]) Then					;MsgBox(0, "Details", "Title=" & $var[$i][0] & @LF & "Handle=" & $var[$i][1])					If $var[$i][0]=="输入要保存的文件名…" And $var[$i][1] <> $handle Then						;MsgBox(64,"hello","have sub Window!!!")						Send("!y")					EndIf				EndIf			Next		EndIf	else		Return False	EndIf	Exit   EndFunc_DownloadFile()

  

AutoIT 实现Firefox下载