分享

VB中的FTP上传文件 下载文件模块代码

 百眼通 2014-10-24
  • 在VB中进行FTP软件开发时用到的两个基本模块,上传文件和下载文件,两函数都挺简单,函数代码如下示:

    一、FTP上传文件函数:

    1Public Function PutFTPFile(ByVal localFile As String, ByVal strRemoteFile As String) As Boolean
    2Dim Info As Boolean
    3If lngInetConn = 0 Then
    4 PutFTPFile = False
    5Else
    6 Info = FtpPutFile(lngInetConn, localFile, strRemoteFile, 1, 0)
    7 PutFTPFile = Info
    8End If
    9End Function

    FTP上传文件函数参数:strRemoteFile 远程文件名;localFile 本地文件名。

    二、FTP下载文件函数:

    1Public Function GetFTPFile(ByVal strRemoteFile As String, ByVal localFile As String) As Boolean
    2Dim Info As Boolean
    3If lngInetConn = 0 Then
    4 GetFTPFile = False
    5Else
    6 Info = FtpGetFile(lngInetConn, strRemoteFile, localFile, 0, 0, 1, 0)
    7 GetFTPFile = Info
    8End If
    9End Function

    FTP下载文件函数参数:strRemoteFile 远程文件名,localFile 本地文件名。

    • 本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
      转藏 分享 献花(0

      0条评论

      发表

      请遵守用户 评论公约

      类似文章 更多