c# - Form a binary number from drop down lists -
so, have 8 drop downwards lists populated values 0 , 1. selected values 8 drop downwards lists, want set them create binary number. there i'd convert binary number decimal(the decimal output displayed in textbox, decimal number alter everytime different number in of drop downwards lists changed).
but i'm unsure of how 8 of selected values combined create 8-bit binary number can convert 1 time number. suggestions on how should start this?
the bad (but easy) way:
convert.toint32(dd7.text + dd6.text + dd5.text + dd4.text + dd3.text + dd2.text + dd1.text + dd0.text, 2)
c#
No comments:
Post a Comment