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 / Managed C++ / November 2005

Tip: Looking for answers? Try searching our database.

String to Hex

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
DanO - 17 Nov 2005 15:17 GMT
I am trying to convert a text string in to hex values.  I am at a loss
of how to get this done. I am also some what new to VC I have worked in
Unix C for a while though.

I am been searching the web for this but can't find the solution I am
looking for.

For example I need to convert the following

ATL100

to the hex equivlent string.

41544C 3130 30

A function or something would be helpful.
James Curran - 21 Nov 2005 20:29 GMT
   Well, if you are will to accept dashes in the string, it's just :

 string input = "ATL100";
 string output =
BitConverter.ToString(System.Text.Encoding.ASCII.GetBytes(input));
   Console.WriteLine(output);

41-54-4C-31-30-30

Signature

Truth,
James Curran
[erstwhile VC++ MVP]

Home: www.noveltheory.com       Work: www.njtheater.com
Blog: www.honestillusion.com  Day Job: www.partsearch.com

> I am trying to convert a text string in to hex values.  I am at a loss
> of how to get this done. I am also some what new to VC I have worked in
[quoted text clipped - 12 lines]
>
> A function or something would be helpful.

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.