Best method to close a keep-alive FTP or FTPS connection in C# (.NET 4.6)?
问题 In C# (.NET 4.6) I am using a keep-alive FTPS connection to download a couple of files in a loop like this: foreach (string filename in filenames) { string requestUriString = GetFtpUriString(myDir) + "/" + filename; FtpWebRequest request = (FtpWebRequest)WebRequest.Create(requestUriString); request.Method = WebRequestMethods.Ftp.DownloadFile; request.Credentials = new NetworkCredential(myFtpsUsername, myFtpsPassword); request.EnableSsl = true; request.ConnectionGroupName =