Solved

How do I convert a Hexstring to Binary in c#?

Posted on 2008-06-22
2
331 Views
Last Modified: 2013-12-16
How do I convert a binary hex string representation to type binary.

basically I have
string hexString = "0x0001B"

What I want is
Binary b = (hexString)'To Binary';

Whats the easiest way to do it?

Cheers,
Josh
0
Comment
Question by:Joshscorp
2 Comments
 
LVL 18

Accepted Solution

by:
philipjonathan earned 50 total points
ID: 21843908
0
 
LVL 12

Expert Comment

by:jandromeda
ID: 21844555
Try this code which gives you the binary value of the given hex value.
string binaryValue = Convert.ToString(Convert.ToInt32("0x0001B", 16), 2);

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Word Template Mail merge with vb.net 4 40
C# code editing and collaboration 3 47
Create XML 5 34
Spacing between controls 4 17
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This video discusses moving either the default database or any database to a new volume.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now