Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using FTP and clearing out memory
Message
De
25/04/2013 17:24:01
 
 
À
25/04/2013 16:36:59
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01571897
Message ID:
01571926
Vues:
31
>Yes - but that is to Dispose() of loStreamReader

Thanks

>Yes
>
>something like
>
>			// 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
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform