Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / August 2006

Tip: Looking for answers? Try searching our database.

Binary or hex numbers in textboxes?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ole - 28 Aug 2006 10:47 GMT
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
Mark Jerde - 28 Aug 2006 11:28 GMT
There are several samples at codeproject.  A few:

http://www.codeproject.com/csharp/hexencoding.asp
http://www.codeproject.com/csharp/hexconverter.asp
http://www.codeproject.com/string/hexstrtoint.asp

HTH.

  -- Mark

> Hi,
>
[quoted text clipped - 11 lines]
> Thanks,
> Ole
Ole - 28 Aug 2006 12:18 GMT
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

> There are several samples at codeproject.  A few:
>
[quoted text clipped - 21 lines]
>> Thanks,
>> Ole

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.