> // this part outside the loop - even at class level if possible > > Uri uri = new Uri(lcURI); > NetworkCredential credentials = new System.Net.NetworkCredential(cUsername, cPassword); > // end part outside the loop > > // FTP setup > var loFtpWebRequest = System.Net.FtpWebRequest.Create(uri); > loFtpWebRequest.Credentials = credentials; > loFtpWebRequest.Method = System.Net.WebRequestMethods.Ftp.ListDirectoryDetails; > > // If we use FTP/SSL (AUTH SSL) > // If ( nNoFTPProtocol == 2) > // loFtpWebRequest.EnableSsl = true; > > > using ( var loFtpWebResponse = loFtpWebRequest.GetResponse() ) > { > using ( var s = loFtpWebResponse.GetResponseStream()) > { > using( var loStreamReader = new StreamReader(s) ) > { > > // Load the files into the string builder > loStringBuilder.LoadString(loStreamReader.ReadToEnd()); > } > } > } > > } >Thanks