dcsimg
Results 1 to 6 of 6

Thread: how to get files md5 checksum?

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Posts
    13

    how to get files md5 checksum?

    First : Select file
    Second : Show in textbox md5 checksum from my select file

    how can i do? Thanks

  2. #2
    Frenzied Member jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    1,581

  3. #3
    Bad man! ident's Avatar
    Join Date
    Mar 2009
    Location
    Cambridge
    Posts
    5,329

    Re: how to get files md5 checksum?

    There are a number of ways, My personal choice was to use PS.

    http://www.vbforums.com/showthread.p...Preference-etc

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Posts
    13

    Re: how to get files md5 checksum?

    Quote Originally Posted by ident View Post
    There are a number of ways, My personal choice was to use PS.

    http://www.vbforums.com/showthread.p...Preference-etc
    how to use in vb.net? please give me example with a file?

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2018
    Posts
    13

    Re: how to get files md5 checksum?

    Quote Originally Posted by ident View Post
    There are a number of ways, My personal choice was to use PS.

    http://www.vbforums.com/showthread.p...Preference-etc
    how to use in vb.net? please give me example with a file? thanks

  6. #6
    Member Grant Swinger's Avatar
    Join Date
    Jul 2015
    Posts
    59

    Re: how to get files md5 checksum?

    System.Security.Cryptography has functions for that. This will return a string with the MD5 checksum.

    Code:
    Imports System.IO
    Imports System.Security.Cryptography
    Module Module1
    
        Sub Main()
            Dim md5sum As String = CreateMD5Sum("path_to_your_file")
            Console.WriteLine("MD5 sum is " & md5sum)
        End Sub
    
        Private Function CreateMD5Sum(ByVal filename As String) As String
            Using md5 As MD5 = MD5.Create()
    
                Using stream = File.OpenRead(filename)
                    Return BitConverter.ToString(md5.ComputeHash(stream)).Replace("-", String.Empty)
                End Using
            End Using
        End Function
    
    End Module

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width