Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Revision on Byte to Hexadecimal
Message
From
03/02/2014 11:46:11
 
 
To
03/02/2014 11:36:10
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
VB 9.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01592982
Message ID:
01593013
Views:
27
>>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform