> Dim loFTP As Framework.Framework.FTP = New Framework.Framework.FTP(oApp) > > ' For each record > For lnCounter = 0 To loData.nCount - 1 > loRow = loData.oRows(lnCounter) > > ' Initiate FTP settings > loFTP.cHost = lcHost > loFTP.cUsername = Trim(loRow("Username")) > loFTP.cPassword = Trim(loRow("Password")) > loFTP.cRemoteDirectory = "Accounting/Received" > > ' If we cannot get the directory > If Not loFTP.GetDirectory() Then > End If > > Next >>
> Dim loFTP As Framework.Framework.FTP = Nothing > > ' For each record > For lnCounter = 0 To loData.nCount - 1 > loRow = loData.oRows(lnCounter) > > loFTP = New Framework.Framework.FTP(oApp) > > ' Initiate FTP settings > loFTP.cHost = lcHost > loFTP.cUsername = Trim(loRow("Username")) > loFTP.cPassword = Trim(loRow("Password")) > loFTP.cRemoteDirectory = "Accounting/Received" > > ' If we cannot get the directory > If Not loFTP.GetDirectory() Then > End If > > Next >>
> ' URI > lcURI = lcServerType + "://" + cHost + lcPort + "/" + lcDrive + cRemoteDirectory > > ' For each retry > For lnCounter = 1 To lnRetry > > ' Reset the values > cMessage = "" > > Try > > ' FTP setup > loFtpWebRequest = System.Net.FtpWebRequest.Create(New Uri(lcURI)) > loFtpWebRequest.Credentials = New System.Net.NetworkCredential(cUsername, cPassword) > loFtpWebRequest.Method = System.Net.WebRequestMethods.Ftp.ListDirectoryDetails > > ' If we use FTP/SSL (AUTH SSL) > If nNoFTPProtocol = 2 Then > loFtpWebRequest.EnableSsl = True > End If > > loFtpWebResponse = loFtpWebRequest.GetResponse() > > loStreamReader = New StreamReader(loFtpWebResponse.GetResponseStream()) > > ' Load the files into the string builder > loStringBuilder.LoadString(loStreamReader.ReadToEnd()) >>