设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

12
返回列表 发新帖
楼主: jzwwpp
打印 上一主题 下一主题

[新4]用ACCESS向ftp服务器上传文件

[复制链接]
11#
发表于 2005-5-12 18:09:00 | 只看该作者
有没有更好的方法!!!
12#
发表于 2006-3-9 17:50:00 | 只看该作者
高手啊。。。。。。。
13#
发表于 2006-4-17 02:20:00 | 只看该作者
可以使用Catalyst File Transfer Control 4.0 (SP3)控件

Private Sub Command6_Click() '上传
Dim strLocalFullName As String
Dim strRemoteFullName As String
Dim lResult As Long

strLocalFullName = Me.TxtLocalName
strRemoteFullName = FullName(TxtRemoteFolder, TxtRemoteFileName)

    FileTransfer2.ServerType = GetServerType
    FileTransfer2.ServerName = Me.TxtSeverName
    FileTransfer2.ServerPort = 21
    '以下根据需要决定
    'FileTransfer2.Timeout = CLng(Val(editTimeout.Text))
    'FileTransfer2.UserName = Trim(editUserName.Text)
    'FileTransfer2.Password = Trim(editPassword.Text)
    lResult = FileTransfer2.Connect
    If lResult <> 0 Then
            MsgBox "Connection failed" & vbCrLf & FileTransfer21.LastErrorString
    End If
   
lResult = FileTransfer2.PutFile(strLocalFullName, strRemoteFullName)

If lResult <> 0 Then
            MsgBox "Transfer failed" & vbCrLf & FileTransfer2.LastErrorString
End If

lResult = FileTransfer2.Disconnect
End Sub


Private Function FullName(strDir As String, strFile As String) As String
Dim strDelim As String
Dim strLastChar As String

    strDelim = "\"
    If InStr(strDir, "/") > 0 Then strDelim = "/"
    strLastChar = Right(strDir, 1)
    If strLastChar = strDelim Then
        FullName = strDir & strFile
    Else
        FullName = strDir & strDelim & strFile
    End If
End Function
14#
发表于 2009-7-14 11:35:51 | 只看该作者
EZFTP控件?
15#
发表于 2009-7-14 22:12:23 | 只看该作者
学习一下
16#
发表于 2014-4-17 21:46:40 | 只看该作者
学习
回复

使用道具 举报

17#
发表于 2015-1-9 20:29:16 | 只看该作者
不错
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-5-20 10:18 , Processed in 0.102395 second(s), 28 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表