OpenFTPConnection Method
Class: FTP_SERVICE
This method is internal, is called from FTP_SERVICE::OpenInternet() and do connect to FTP server.
=
Object.OpenFTPConnection
Parameter
lcCurrentFolder
Current folder
Type Character
By reference  
Direction Input
The startup folder afater connecting to FTP server. If this parameter empty, then startup folder will be default FTP server's current folder fro logiing user.
Return value Boolean
The return value is .T. if is connected to ftp server or .F. is not.
Example
See source code of method FTP_SERVICE::OpenInternet()
See also
Expand/Collapse source code of procedure OpenFTPConnection Source Code
      LPARAMETERS OPT_INP lcCurrentFolder
      LOCAL nHandle, lnConnect_Handle
      IF This.nConnect_Handle>0 AND .T. && is Valid??
         RETURN .T.
      ENDIF
      * Open FTP Site 
      lnConnect_Handle = InternetConnect(This.nInet_Handle, (This.cIPAddress), VAL(This.cPort), ;
                        (This.cUserName), (This.cPassword), INTERNET_SERVICE_FTP, This.nFlags, 0)
      This.GetExtendedError()
      IF lnConnect_Handle = 0
         RETURN .F.
      ENDIF

      IF PCOUNT()=0 OR EMPTY(lcCurrentFolder)
         lcCurrentFolder = SPACE(MAX_PATH)      
         fResult = FtpGetCurrentDirectory(lnConnect_Handle, @lcCurrentFolder, MAX_PATH)
         This.GetExtendedError()
      ELSE
         fResult = FtpSetCurrentDirectory(lnConnect_Handle, @lcCurrentFolder)
      ENDIF

      IF fResult = 1
         This.cCurrentDir = lcCurrentFolder
         This.nConnect_Handle = lnConnect_Handle
         RETURN .T.
      ELSE
         This.GetExtendedError()     && Only Get extended Error information when there is an error
         RETURN .F.
      ENDIF