設為首頁收藏本站Access中國

Office中國論壇/Access中國論壇

 找回密碼
 注冊

QQ登錄

只需一步,快速開始

12
返回列表 發(fā)新帖
樓主: jzwwpp
打印 上一主題 下一主題

[新4]用ACCESS向ftp服務器上傳文件

[復制鏈接]
11#
發(fā)表于 2005-5-12 18:09:00 | 只看該作者
有沒有更好的方法!!!
12#
發(fā)表于 2006-3-9 17:50:00 | 只看該作者
高手啊。。。。。。。
13#
發(fā)表于 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
    '以下根據(jù)需要決定
    '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#
發(fā)表于 2009-7-14 11:35:51 | 只看該作者
EZFTP控件?
15#
發(fā)表于 2009-7-14 22:12:23 | 只看該作者
學習一下
16#
發(fā)表于 2014-4-17 21:46:40 | 只看該作者
學習
回復

使用道具 舉報

17#
發(fā)表于 2015-1-9 20:29:16 | 只看該作者
不錯
回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則

QQ|站長郵箱|小黑屋|手機版|Office中國/Access中國 ( 粵ICP備10043721號-1 )  

GMT+8, 2025-7-17 06:02 , Processed in 0.087065 second(s), 28 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回復 返回頂部 返回列表