⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fce4vb_r.txt

📁 建设银行计算机设备台帐程序计算机设备管理程序。其中包括一个网络文件传输示例
💻 TXT
📖 第 1 页 / 共 3 页
字号:




                           FTP Client Engine

                       Library for Visual Basic


                                (FCE4VB)


                           REFERENCE MANUAL



                              Version 1.2

                            August 16, 1999




                     This software is provided as-is.
              There are no warranties, expressed or implied.




                           Copyright (C) 1999
                           All rights reserved



                       MarshallSoft Computing, Inc.
                           Post Office Box 4543
                           Huntsville AL 35815


                           Voice : 256-881-4630
                             FAX : 256-880-0925
                           email : info@marshallsoft.com
                             web : www.marshallsoft.com

                               _______
                          ____|__     |                (R)
                       --+       |    +-------------------
                         |   ____|__  |  Association of
                         |  |       |_|  Shareware
                         |__|   o   |    Professionals
                       --+--+   |   +---------------------
                            |___|___|    MEMBER


      MARSHALLSOFT is a registered trademark of MarshallSoft Computing.




     FCE4VB Reference Manual                                    Page 1

                            C O N T E N T S



        Chapter                                     Page

        Table of Contents.............................2

        General Remarks...............................3

        FCE Functions.................................3

           fceAbort...................................3
           fceAttach..................................5
           fceClose...................................5
           fceConnect.................................6
           fceDelFile.................................7
           fceDelServerDir............................8
           fceDriver..................................9
           fceErrorText..............................10
           fceExtract................................11
           fceGetFile................................12
           fceGetInteger.............................13
           fceGetList................................14
           fceGetLocalDir............................15
           fceGetServerDir...........................16
           fceGetString..............................17
           fceMakeServerDir..........................18
           fcePutFile................................19
           fceRelease................................20
           fceSetInteger.............................21
           fceSetLocalDir............................23
           fceSetMode................................24
           fceSetServerDir...........................25
           fceSetString..............................26























     FCE4VB Reference Manual                                    Page 2

      General Remarks

      All functions return an integer code. Negative values are always
      errors. See Section 11.3 "FCE Error Return Code List" in the FCE
      Users Manual (FCE4VB_U.TXT). Non-negative return codes are never
      errors.

      Note that all integer variables in Win32 are declared as LONG rather
      than INTEGER. This is because INTEGERS use 2 bytes in Visual Basic,
      rather than 4 bytes used in Win32 C/C++ compilers.

      Integer variables in Win16 (VB 3.0) are declared as INTEGER. This
      manual shows the Win32 declarations, rather than the Win16
      declarations. Refer to SEE16.BAS and SEE32.BAS.

      All strings passed to FCE functions should be terminated by an Ascii
      null. For example,

            Dim X As String
            X = "Hello, world" + Chr$(0)

      FCE Functions


      +----------+--------------------------------------------------------+
      | fceAbort | Abort file fceDriver.                                  |
      +----------+--------------------------------------------------------+


        SYNTAX  Declare Function fceAbort(
                    ByVal Chan As Long)        'channel number

       REMARKS  The fceAbort function is used to abort the FCE state
                driver. This is used when calling the FCE state driver
                (fceDriver) directly and it is neccessary to abort.

                After calling fceAbort, subsequent calls to fceDriver will
                return 0 (IDLE). Thus, FCE is ready for the next command.

                This function is not required unless the state driver
                fceDriver is being called directly.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'called when user pushes STOP button on the form.

                 Sub buttonStop_Click()
                 Dim Code As Long
                 'abort driver
                 Code = fceAbort(0)
                 End Sub

      ALSO SEE fceDriver



     FCE4VB Reference Manual                                    Page 3

      +-----------+-------------------------------------------------------+
      | fceAttach | Initializes FCE.                                      |
      +-----------+-------------------------------------------------------+


        SYNTAX  Declare Function fceAttach(
                    ByVal NbrChans As Long, 'Number of channels or threads
                    ByVal KeyCode As Long)  'Registration key code.

       REMARKS  The fceAttach function must be the first FCE call made.
                Pass the maximum number of channels or threads that will be
                in use. Use NbrChans = 1 for non-threaded applications.

                The 'Chan'parameter for subsequent calls to FCE functions
                must be in the range of 0 to NbrChans-1.

                In WIN32, up to 32 threads (numbered from 0 to 31) can be
                started, each of which can be connected to a different FTP
                server and run independently.

                When FCE is registered, you will receive a 'KeyCode' which
                matches the 'KeyCode'within the registered DLL. For the
                shareware version, the keycode is 0. See KEYCODE.BAS.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Initialize FCE (look in KEYCODE.BAS for FCE_KEY_CODE)
                Code = fceAttach(1, FCE_KEY_CODE)

                'call any FCE function except fceAttach and fceRelease.
                'Pass 0 as the channel number.

                'Terminate FCE
                Code = fceRelease()

      ALSO SEE fceRelease.




















     FCE4VB Reference Manual                                    Page 4

      +----------+--------------------------------------------------------+
      | fceClose | Closes connection opened by fceConnect.                |
      +----------+--------------------------------------------------------+


        SYNTAX  Declare Function fceClose(
                    ByVal Chan As Long)        'channel number

       REMARKS  The fceClose function closes the connection to the FTP
                server opened with fceConnect. After closing, another
                connection on channel 'Chan' may be opened with fceConnect.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                ' Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                ' Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")

                '...List, delete, upload, and download files.

                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()

      ALSO SEE fceConnect.

























     FCE4VB Reference Manual                                    Page 5

      +------------+------------------------------------------------------+
      | fceConnect | Connects to a FTP server.                            |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceConnect(
                    ByVal Chan As Long,    'Channel number.
                    ByVal Server As String,'Server name or dotted IP addr
                    ByVal User As String,  'Users account or "anonymous"
                    ByVal Pass As String)  'Password for above

       REMARKS  The fceConnect function connects to the FTP server
                'Server'and logs on as 'User'with password 'Pass'.

                FTP servers that allow anonymous access will accept "ftp"
                or "anonymous" for the user name and your email address for
                the password.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                'Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If

                '...List, delete, upload, and download files.

                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()


      ALSO SEE fceClose.


















     FCE4VB Reference Manual                                    Page 6

      +------------+------------------------------------------------------+
      | fceDelFile | Deletes file from the FTP server.                    |
      +------------+------------------------------------------------------+


        SYNTAX  Declare Function fceDelFile(
                    ByVal Chan As Long,       'channel number
                    ByVal FileName As String) 'Name of file to delete

       REMARKS  The fceDelFile function is used to delete the file
                'FileName'from the FTP server.

                The delete may fail if either you don't have the necessary
                permission (as is typical when you connect as an anonymous
                user) or the file itself is marked as read-only.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                'Connect to FTP server
                Code = fceConnect(0,"ftp.yourisp.com","user","password")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'delete file
                Code = fceDelFile(0,"PRODUCTS.TXT")
                If Code >= 0 Then
                  PRINT "File deleted"
                Else
                  Call DisplayError(Code)
                  Exit Function
                End If
                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()

      ALSO SEE fcePutFile and fceDelServerDir












     FCE4VB Reference Manual                                    Page 7

      +-----------------+-------------------------------------------------+
      | fceDelServerDir | Deletes the server directory.                   |
      +-----------------+-------------------------------------------------+


        SYNTAX  Declare Function fceDelServerDir(
                    ByVal Chan As Long,       'channel number
                    ByVal DirName As String)  'Name of directory to delete

       REMARKS  The fceDelServerFile function is used to delete the server
                directory 'DirName'from the FTP server.

                The delete may fail if you don't have the necessary
                permission, as is typical when you connect as an anonymous
                user.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                If Code < 0 Then
                  PRINT "Cannot attach FCE"
                  Exit Function
                End If
                'Connect to FTP server
                Code = fceConnect(0,"ftp.yourisp.com","user","password")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'delete server directory MYSTUFF.DIR
                Code = fceDelServerDir(0,"MYSTUFF.DIR")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'close connection.
                Code = fceClose(0)
                'release FCE
                Code = fceRelease()

      ALSO SEE fceDelFile














     FCE4VB Reference Manual                                    Page 8

      +-----------+-------------------------------------------------------+
      | fceDriver | Executes the next state in the FCE state engine.      |
      +-----------+-------------------------------------------------------+


        SYNTAX  Declare Function fceDriver(
                      ByVal Chan As Long)           'Channel

       REMARKS  The fceDriver function executes the next state in the FCE
                state engine.

                This function is only used when FCE_AUTO_CALL_DRIVER is set
                to 0.

                Refer to Section 4.0, "Theory of Operation" in the FCE
                Users Manual (FCE4VB_U.TXT) for more details.

       RETURNS  < 0 : An error has occurred. Call fceErrorText.

       EXAMPLE

                'Attach FCE
                Code = fceAttach(1, FCE_KEY_CODE)
                'Connect to FTP server
                Code = fceConnect(0,"ftp.hiwaay.net","ftp","you@isp.com")
                'turn AUTO CALL off.
                Code = fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 0)
                'ask for file
                Code = fceGetFile(0,"PRODUCTS.TXT")
                If Code < 0 Then
                  Call DisplayError(Code)
                  Exit Function
                End If
                'call the driver until it returns 0
                While fceDriver(0) <> 0
                  'print dot for each call to driver
                  PRINT (".")
                Wend
                'turn AUTO CALL back on
                Code = fceSetInteger(0,FCE_SET_AUTO_CALL_DRIVER, 1)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -