Binary or hex numbers in textboxes?

O

Ole

Hi,

I'm having 2 textboxes in which I enter binary numbers that must be
calculated to a third number that is shown in a third textbox. How do i
convert my entered binary number to an e.g an int and how do I convert the
calculated number to a binary string?

If it's not possible straight away then hex could be the second resolution.
I know how to convert a number to a hex string ToStrin("X"); but not the
opposite way.

Any help is highly appriciated.

Thanks,
Ole
 
O

Ole

Thanks,

I also found these standard methods - very easi to use:
Convert.ToString(number, 2); // where 2 specifies binary format - 8 would
be octal and so on
and:
Convert.ToUInt32(textBox2.Text, 2); // again 2 specifies binary format

Best regards
Ole
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top