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,267
  • 11
  • 43
  • 63
  • [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
  • 406,130
  • 70
  • 637
  • 767
0

You can use Convert.ToByte

Chris Frederick
  • 5,348
  • 3
  • 35
  • 42
Khaled Nassar
  • 884
  • 8
  • 23