System.Convert class

Hi,
I have a Fez Spider with .net micro Framework 4.1 and GHI NETMF v4.1 installed in my computer. I have added using System namespace to my code.
But I cant see the System.Convert class.
What I need to do is;
convert integer to byte
example bytes[0] = Convert.ToByte(23); which is 0x17 as in .Net Framework

Thanks.

The System.Convert functions in NETMF only converts strings.


int x = 1;

//not sure why you would want to do this
System.Convert.ToByte(x.ToString());

//when you can directly cast the integer to a byte
byte b = (byte)x; 


@ ransomhall - except

Convert.ToChar(ushort value) and  Convert.ToBase64String(byte[] inarray)

:smiley:

And if you want higher bytes just use right shift.

Thanks for the replies.
And why can I not see the convert class. Am I missing to add a reference?