Visual Studio Development Bookmark and Share   
 index > Visual C# Express Edition > Hex from serialPort2.ReadExisting();
 

Hex from serialPort2.ReadExisting();

I am reading a Hex string using C#

RxString2 = serialPort2.ReadExisting();

and need the data not in a ASCII form but in hex.
I saw a Hex() in VB  but it is not recognized in C#

tfcsd  Wednesday, October 14, 2009 4:32 PM
You should be using Read(), not ReadExisting().  So you get bytes instead of characters.  Turning the bytes in the human-readable hex is easy with the BitConverter.ToString(byte[]) overload.

Hans Passant.
nobugz  Wednesday, October 14, 2009 6:45 PM

You can use google to search for other answers

Custom Search

More Threads

• NotifyIcon question
• Help installing and running Visual C# express 2005
• unique id in infopath
• Layout toolbar abnd wpf
• Convert an index into x/y value
• How to debug multithreaded application with visual c# express ?
• All menu items appear twice or thrice in V C# 2008 express editions...
• Array Question
• Help with sub-forms
• C# Runs commands from whre the program was launched