Convert Hex To Byte

Easy Answer: Open up Calculator and make sure its on Scientific mode. Make sure Hex is clicked (just under the display). Punch in 99, click on binary and you get 10011001.

Complex Answer: Google it. Its an annoying MOD math...
basically Hex is a base16 number system. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F.

Decimal (the common number system) is base10 (deci, get it?). Binary is base2 (bi). Binary only has 0 and 1. 8 digits in a byte.

theres a conversion forumla. Its been a year since Ive used it, so I wouldnt trust my memory. Google for Base16 to Base2 conversions and you should find it. Maybe someone here is into Assembler and knows it well.
 
thanks, but i meant how do i convert it within .net. sorry i wasnt completely clear.

maybe this will help make more sense.

im porting over a visualbasic.net midi class to c#.

Here is how the method in vb:
Public Sub SendMsg(ByVal Status As Byte, Data1 As Byte, Data2 As Byte)
...

and here is how it is called:
Midi.SendMsg(&H99, 38, 127)

Im trying to figure out how to call it the same way in c#. in peticular the &H99 part.
 
Back
Top