Diverses Zugferd
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
Imports System.IO
|
||||
Imports System.Reflection
|
||||
Imports System.Security.Cryptography
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Xml
|
||||
Imports DigitalData.Modules
|
||||
@@ -100,4 +101,29 @@ Public Class Form1
|
||||
Console.WriteLine()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
|
||||
My.Settings.Save()
|
||||
Dim result = checkMD5(txtMD5Checksum.Text)
|
||||
MsgBox("Done")
|
||||
End Sub
|
||||
Public Function checkMD5(ByVal filename As String) As String
|
||||
Try
|
||||
Dim MD5 As New MD5CryptoServiceProvider
|
||||
Dim Hash As Byte()
|
||||
Dim Result As String = ""
|
||||
Dim Tmp As String = ""
|
||||
|
||||
Dim FN As New FileStream(filename, FileMode.Open, FileAccess.Read, FileShare.Read, 8192)
|
||||
MD5.ComputeHash(FN)
|
||||
FN.Close()
|
||||
|
||||
Hash = MD5.Hash
|
||||
Result = Strings.Replace(BitConverter.ToString(Hash), "-", "")
|
||||
Return Result
|
||||
Catch ex As Exception
|
||||
Return Nothing
|
||||
End Try
|
||||
|
||||
End Function
|
||||
End Class
|
||||
|
||||
Reference in New Issue
Block a user