I want to convert 000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717 hex value to it's binary format (to a string of binary), but following code throws an exception if either value being too big or too small. Why is that?
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
Dim binstring As String
Dim hexstring As String = "000000000000000117c80378b8da0e33559b5997f2ad55e2f7d18ec1975b9717"
binstring = Convert.ToString(Convert.ToInt32(hexstring, 16), 2)
T5.Text = binstring
End Sub
Convert.ToInt32(hexstring, 16)which tries to convert your hex string to a 32-bit integer. The string in your example converts to a number that is far more than 32 bits.