如何在vb.net中获取SHA1,SHA256,SHA512,MD5校验值本身?VB.Net如何获得汇编校验和(SHA1,MD5,SHA256,SHA512)值?
我可以从第三方实用程序如哈希得到我的exe文件校验和值... 但我想获得我自己的程序集校验和值本身?
请帮助
更新:1我想我自己
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim _myexe$
Try
_myexe$ = IO.Path.Combine(My.Application.Info.DirectoryPath, My.Application.Info.AssemblyName & ".exe")
Using _sha512 As New System.Security.Cryptography.SHA512CryptoServiceProvider
Using stream = File.OpenRead(_myexe$)
Dim _hash = _sha512.ComputeHash(stream)
Trace.WriteLine(BitConverter.ToString(_hash).Replace("-", String.Empty))
End Using
End Using
Catch ex As Exception
Trace.WriteLine(Err.Description)
End Try
End Sub
是获得校验值电流(运行)装配这个正确的方式?
仅供参考,你可以替换整个'IO.Path.Combine(My.Application.Info.DirectoryPath,My.Application.Info.AssemblyName与名为 “.exe”)'和' Application.ExecutablePath'。 –
非常感谢你得到程序集路径+1 – DVELPR