VBScript写上传FTP

来源:互联网 发布:c语言整齐输出99乘法表 编辑:程序博客网 时间:2024/06/05 06:00

使用VBScript写一个上传FTP的Function,首先注册ASPFTP.DLL,代码部分如下:

Function UpLoadFTP()

 Dim ServerName, User, Pwd, RemoteFile, Localfile, TransType,objFTP,abcResult

 Set objFTP = CreateObject("NIBLACKLI.ASPFTP")

 ServerName="XXXXX"

 User="XXXX"

 Pwd="XXXXX"

 TransType=0

 RemoteFile="xxxx"

 Localfile="xxxx"

 'RemoteFile注意:假如LocalFile="d:/aaa.txt",FTP上的路径为test,则Remotefile="text/aaa.txt"

 abcResult= objFTP.bQPutFile(ServerName, User, Pwd, Localfile, RemoteFile, TransType)

 set objFTP=Nothing

end function

原创粉丝点击