|
-
April 22nd, 2008, 08:22 AM
#1
How to print Binary digit
Dear friends,
I am coding in Visual C# windows application. I like to set a Label Text property with given integer's binary.
eg. I have 1 Label, 1 TextBox and 1 Button when i type 4 in textbox and click on button i want to set label text property with number four's binary that is 0000 0100.
Kindly tell me how i can print Binary on Form.
-
April 22nd, 2008, 09:09 AM
#2
Re: How to print Binary digit
Quick google search revealed this:
Code:
int i = 100;
string str = Convert.ToString(i, base); //base = 2, 8,10 or 16
You'll obviously want to use base 2 for binary.
-
April 23rd, 2008, 02:56 AM
#3
Re: How to print Binary digit
Thank you very much dear it works nice.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|