DialInternet Method
Class: FTP_SERVICE
Attempts to use a preconfigured Dial Up account to connect to the internet.
=
Object.DialInternet
Parameter
lcDialUpName
Name of the DialUp Connection to use.
Type Character
Direction Input
lnFlag
Type Numeric
Direction Input
ValueDescription
INTERNET_AUTODIAL_FORCE_ONLINE Forces an online Internet connection.
INTERNET_AUTODIAL_FORCE_UNATTENDED Forces an unattended Internet dial-up.
INTERNET_AUTODIAL_FAILIFSECURITYCHECK Causes InternetAutodial to fail if file and printer sharing is disabled for Windows 95 or later.
Assumed from MSDN.
Return value Integer
Connection handle number. 0 if API Call unsuccessful or -1 if foxpro function failed.
Example
LOCAL loFTP, liState,liCID
SET PROCEDURE TO ftp.prg ADDITIVE 
loFTP=CREATEOBJECT('ftp_service') 
liState=loFTP.GetConnectedState() && Check Connected state
IF liState=-1
   ?loFTP.GetExtendedErrorCode(),loFTP.GetExtendedErrorMsg()
   RETURN
ENDIF

IF BITTEST(liState,0) && Use Modem?
   liCID=loFTP.DialInternet("MACONNEXION",1) 
ENDIF

IF (BITTEST(liState,0) AND liCID>0 OR !BITTEST(liState,0)) AND ;
   loFTP.OpenInternet("ABONNE", "PWD", "10.10.10.10", "21") 
   * Try to get a handle into the Internet and Connect Briefly with the FTP Site 
   * Note: Insert your USER ID, PASSWORD, FTP ADDRESS, PORT # Here   
   * Note: ("21" is the Default Port) 
   ?"Connection réussie" 

   =loFTP.CloseInternet() 
ENDIF
=loFTP.DialHangUp(liCID) 
RELEASE PROCEDURE ftp.prg
See also
Expand/Collapse source code of procedure DialInternet Source Code
      LPARAMETERS INP lcDialUpName, INP lnFlag
      LOCAL fResult, lnConnectionID, lnHWNDHandle
      IF This.LoadAPIFuncs() != ERROR_SUCCESS
         RETURN -1
      ENDIF

      STORE 0 TO lnConnectionID,lnHWNDHandle

      IF TYPE("lcDialUpName") != "C" OR ;
         TYPE("lnFlag") != "N"
         RETURN -1
      ENDIF

      IF LEN(ALLTRIM(lcDialUpName)) = 0 
         RETURN -1
      ENDIF

      lcDialUpName = lcDialUpName + cNULL
      =This.BeforeDialInternet(lcDialUpName, lnFlag)
      fResult = InternetDial(lnHWNDHandle, @lcDialUpName, lnFlag, @lnConnectionID, 0)
      =This.GetExtendedError()
      =This.AfterDialInternet(@lcDialUpName, lnFlag,lnConnectionID,fResult)
      RETURN lnConnectionID