Click here to Skip to main content
15,887,350 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to convert string to asci and asci to hex Pin
pallaka2-Aug-09 23:20
pallaka2-Aug-09 23:20 
GeneralRe: How to convert string to asci and asci to hex Pin
riced2-Aug-09 23:36
riced2-Aug-09 23:36 
AnswerRe: How to convert string to asci and asci to hex Pin
gwithey2-Aug-09 23:19
gwithey2-Aug-09 23:19 
GeneralRe: How to convert Hexa to Ascii and Ascii to hexa Pin
pallaka2-Aug-09 23:43
pallaka2-Aug-09 23:43 
GeneralRe: How to convert Hexa to Ascii and Ascii to hexa Pin
gwithey2-Aug-09 23:54
gwithey2-Aug-09 23:54 
GeneralRe: How to convert Hexa to Ascii and Ascii to hexa Pin
pallaka2-Aug-09 23:58
pallaka2-Aug-09 23:58 
GeneralRe: How to convert Hexa to Ascii and Ascii to hexa Pin
gwithey3-Aug-09 0:10
gwithey3-Aug-09 0:10 
AnswerRe: How to convert string to asci and asci to hex Pin
Luc Pattyn2-Aug-09 23:58
sitebuilderLuc Pattyn2-Aug-09 23:58 
Hi,

The solution will take some 10 lines of code including an explicit loop.

here are a few things you will need:
1. split the input string (which is a hex string) into parts, each holding 2 hex digits; you could use string.Split() or string.Substring()
2. convert a 2-digit hex string to its numeric value; you need int.Parse() or int.TryParse() with some options
3. convert that number to an ASCII character; you might try that with a (char) cast, the safer way would use an Encoding method.
4. concatenate all the results; either use a string operator or StringBuilder class.

If all this is too much for you, this is what you should have done: http://lmgtfy.com/?q=convert+hex+string+to+ASCII[^]

Smile | :)

Luc Pattyn [Forum Guidelines] [My Articles]

The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.

QuestionDissable left click (Only on a trackBar) Pin
gwithey2-Aug-09 23:02
gwithey2-Aug-09 23:02 
AnswerRe: Dissable left click (Only on a trackBar) Pin
codemunkeh3-Aug-09 18:28
codemunkeh3-Aug-09 18:28 
QuestionProblem with ReadExisting in serial communication...i am sending data in hexa decimal but i am reciving it in asci..... Pin
pallaka2-Aug-09 22:09
pallaka2-Aug-09 22:09 
AnswerRe: Problem with ReadExisting in serial communication...i am sending data in hexa decimal but i am reciving it in asci..... Pin
stancrm2-Aug-09 22:18
stancrm2-Aug-09 22:18 
GeneralRe: Problem with ReadExisting in serial communication...i am sending data in hexa decimal but i am reciving it in asci..... Pin
pallaka2-Aug-09 22:47
pallaka2-Aug-09 22:47 
GeneralRe: Problem with ReadExisting in serial communication...i am sending data in hexa decimal but i am reciving it in asci..... Pin
OriginalGriff2-Aug-09 22:57
mveOriginalGriff2-Aug-09 22:57 
GeneralRe: Problem with ReadExisting in serial communication...i am sending data in hexa decimal but i am reciving it in asci..... Pin
pallaka2-Aug-09 23:11
pallaka2-Aug-09 23:11 
GeneralRe: Problem with ReadExisting in serial communication...i am sending data in hexa decimal but i am reciving it in asci..... Pin
OriginalGriff2-Aug-09 23:22
mveOriginalGriff2-Aug-09 23:22 
QuestionWPf questions about custom control Pin
TGiril2-Aug-09 21:35
TGiril2-Aug-09 21:35 
AnswerRe: WPf questions about custom control Pin
Abhijit Jana2-Aug-09 21:49
professionalAbhijit Jana2-Aug-09 21:49 
QuestionCreating a ContextMenu at runtime... Pin
Thomas Kemper2-Aug-09 20:38
Thomas Kemper2-Aug-09 20:38 
AnswerRe: Creating a ContextMenu at runtime... Pin
stancrm2-Aug-09 21:07
stancrm2-Aug-09 21:07 
GeneralRe: Creating a ContextMenu at runtime... Pin
Thomas Kemper2-Aug-09 21:13
Thomas Kemper2-Aug-09 21:13 
GeneralRe: Creating a ContextMenu at runtime... Pin
Alan N3-Aug-09 2:19
Alan N3-Aug-09 2:19 
GeneralRe: Creating a ContextMenu at runtime... Pin
Thomas Kemper3-Aug-09 13:27
Thomas Kemper3-Aug-09 13:27 
Questionhow to print a web page in c# without using Javascript Pin
smiley_jatin2-Aug-09 20:34
smiley_jatin2-Aug-09 20:34 
AnswerRe: how to print a web page in c# without using Javascript Pin
Christian Graus2-Aug-09 20:38
protectorChristian Graus2-Aug-09 20:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.