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
]])
|
本文提供了一段使用AutoIT脚本语言实现Firefox浏览器中文件上传功能的具体代码。该脚本通过设置窗口标题匹配模式、激活窗口、设置文件路径及点击按钮等步骤实现了文件上传流程。
1559

被折叠的 条评论
为什么被折叠?



