Dim bytAllBytes() As Byte = System.IO.File.ReadAllBytes("FILEPATH")
Dim strHex As String = String.Empty
For Each bytTemp As Byte In bytAllBytes
'For your exact requirements
strHex &= bytTemp.ToString("X2") & " "
'however, you can use "X4" or "Xn" where replacing "n" with a numeric value will pad that number of zeros in the begining
Next
MessageBox.Show(strHex)
|