Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Revision on Byte to Hexadecimal
Message
De
03/02/2014 11:46:11
 
 
À
03/02/2014 11:36:10
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01592982
Message ID:
01593013
Vues:
26
>>Still, you need a USING. If you don't do that, you're giving extra work to the garbage collector
>
>Like this?
>

I would put the Using loMD5CryptoServiceProvider = New MD5CryptoServiceProvider() outside the for/next loop
Using loMD5CryptoServiceProvider = New MD5CryptoServiceProvider()

//  here the for
     Using loStream As Stream = New FileStream(cFileName, FileMode.Open)

     end using
// here next

 End Using
>
>                    ' Open the destination
>                    Using loStream As Stream = New FileStream(cFileName, FileMode.Open)
>
>                        ' Create the crypto service provider object
>                        Using loMD5CryptoServiceProvider = New MD5CryptoServiceProvider()
>
>                            ' Compute the hash of the fileStream
>                            oMD5 = loMD5CryptoServiceProvider.ComputeHash(loStream)
>
>                        End Using
>
>                    End Using
>
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform