0

I've made a window form application that send keys but in order to send keys I do this:

To send 'A' I have to write down MyFunction(0x41). 0x41 is a byte.

I can get the 41 as a string, but how do I convert it to a byte (of this format - 0x41)

Or Betzalel
  • 2,427
  • 11
  • 47
  • 70
  • [This may help][1] [1]: http://stackoverflow.com/questions/3802542/how-do-convert-string-to-byte-in-c – dawebber May 02 '11 at 02:34

2 Answers2

1

You can cast it to an integer type:

MyFunction((byte)'A');
Stephen Cleary
  • 437,863
  • 77
  • 675
  • 810
0

You can use Convert.ToByte

Chris Frederick
  • 5,482
  • 3
  • 36
  • 44
Khaled Nassar
  • 884
  • 8
  • 23