The following should work:-
n = Int32.Parse("4C", NumberFormat.HexNumber);
Peter
--
Peter Foot
Windows Embedded MVP
OpenNETCF.org Senior Advisor
www.inthehand.com |
www.opennetcf.org
"Panhuber Astrid" <(E-Mail Removed)> wrote in message
news:uwF%23ib6$(E-Mail Removed)...
> hi!
>
> can anyone please give me a hint, how to convert a hex-string to an
> integer?
>
> I know how to convert a decimal string (such as "51", "27", ...):
> n = System.Convert.ToInt32(str);
>
> But how to convert a hex string (such as "4C" or "0x4C")? If I use the
> same
> function, it throws me an exception.
>
>
>
> Thanks in advance,
>
> astrid
>
>