kitomitt 发表于 2008-8-25 11:09:02

请高手帮忙!!!

请高手帮忙写个VBS的代码,就是下载WEB上的文件,比如http://www.tdt.com/1.rar

然后保存在指定文件夹,d:\down\

最最重要的是,以当年系统时间来命名文件名200805311912.rar

1912表示19点12分

lingxin5013 发表于 2008-8-25 11:10:23

hard for me

zte_boy 发表于 2008-8-25 12:07:23

这个我的blog中有,你可以参考下
http://www.51testing.com/?161787/action_viewspace_itemid_88686.html

kitomitt 发表于 2008-9-2 15:08:36

有人会吗~~???

fengmingbao 发表于 2008-9-2 16:33:38

回复 4# 的帖子

做点必要的修改,

Browser("AA").Page("BB").Link("qtp_reference_guide_cn.pdf").Click
wait(1)
Browser("Browser_2").Dialog("File Download").WinButton("Save").TypemicLeft
wait(1)
Browser("Browser_2").Dialog("File Download").WinButton("Open").TypemicRight
wait(1)
Browser("Browser_2").Dialog("File Download").TypemicReturn
wait(1)
Dialog("File Download").Dialog("Save As").WinToolbar("ToolbarWindow32").Press "My Computer"
wait(1)

'Change to D: disk
Dialog("File Download").Dialog("Save As").WinListView("SysListView32").Activate " (C:)"
wait(1)

'Change to your folder
Dialog("File Download").Dialog("Save As").WinListView("SysListView32").Activate "Logs"
wait(1)


Dialog("File Download").Dialog("Save As").WinComboBox("Save as type:").Select "All Files"
wait(1)

'26 is the default length of existing file name, change it
Dialog("File Download").Dialog("Save As").WinEdit("File name:").SetSelection 0,26
wait(1)
tempYear = Year(Date)
tempMonth = Month(Date)
tempDay = Day(Date)
tempHour = Hour(time)
tempMinute = Minute(time)
finalstr = tempYear&tempMonth&tempDay&tempHour&tempMinute&".rar"
print finalstr
Dialog("File Download").Dialog("Save As").WinEdit("File name:").Set tempYear&tempMonth&tempDay&tempHour&tempMinute&".rar"
wait(1)
Dialog("File Download").Dialog("Save As").WinButton("Save").Click
页: [1]
查看完整版本: 请高手帮忙!!!