致力于测试团队建设和自动化测试开发,欢迎有兴趣者一起研究讨论
使用XMLHttp和ADODB.Stream取得远程文件并保存
上一篇 /
下一篇 2008-07-23 12:15:56
/ 个人分类:Automation
-~0q;Gu4qs+K;k0'取得远程文件并保存到本地
5zW+i#w1M0Function GetRemoteFiels(RemotePath, LocalPath, FileName) 51Testing软件测试网p#RxA;C/z&D2o"J
Dim strBody
vW&`6i{0Dim FilePath 51Testing软件测试网+p*um;FU?P
b
51Testing软件测试网;SO$^0oP-`~
On Error Resume Next
8OW)D ^1U1AWoej051Testing软件测试网H,?8^dz-D;M
\1vB3p^
'取得流
p:u;w"BiO"X0strBody = GetBody(RemotePath)
q-[:LO1fH'I(Sx0'取得保存的文件名
$E5s(\
g"H"z
I$nTP0if Right(LocalPath, 1) <> "\" then LocalPath = LocalPath & "\"
BM~1w4?V0FilePath = LocalPath & GetFileName(RemotePath, FileName) 51Testing软件测试网1rK0^3AT
'保存文件 51Testing软件测试网3W.L`K@#N
if SaveToFile(strBody, FilePath) = true and err.Number = 0 then
/J#zCVo1k']F|:x*H&E0 GetRemoteFiles = true
)s'QX1i(D/^6i0else
8K&q~!G;H/WC0 GetRemoteFiles = false
8^-m!Hh0l!l @0end if
0r$W{
X&x