AutoIT 实现Firefox上传文件
Firefox浏览器文件上传代码如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
;upload file
Func _UploadFile($file)
AutoItSetOption(
"WinTitleMatchMode"
,
2
)
WinWaitActive(
""
,
""
,
15
);
If WinActivate(
""
,
""
) Then
;MsgBox(
64
,
"hello"
,
"have Window!!!"
)
ControlSetText(
""
,
""
,
"[CLASS:Edit; INSTANCE:1]"
,
"D:\b.png"
)
ControlClick(
""
,
""
,
"[CLASS:Button; TEXT:打开(&O)]"
)
Else
Return False
;MsgBox(
64
,
"hello"
,
"No Window!!!"
)
EndIf
Exit
EndFunc
_UploadFile($CmdLine[$CmdLine[
0
]])
|