How to Dispose?

  • Thread starter Thread starter RAT_SL
  • Start date Start date
R

RAT_SL

Guest
Hi,

Here is my issue regarding Warning CA2000.. Thank You...!!!


Private Shared Function EncryptString(str As String) As String
Dim bytes As Byte() = Text.Encoding.ASCII.GetBytes(str)
#Disable Warning CA2000 ' Dispose objects before losing scope
Dim hashed = Security.Cryptography.SHA256.Create().ComputeHash(bytes)
#Enable Warning CA2000 ' Dispose objects before losing scope
Return Convert.ToBase64String(hashed)
End Function

End Class


How to fix this code?


RohanD

Continue reading...
 
Back
Top