473,385 Members | 1,742 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to convert Hex into readable values

aaa
I have a third party DLL that downloads everything from a device to a
particular device into the following Hex format:

080 : 13 70 05 00 (Timestamp)
081 : 35 E1 91 F9 9F BF (Mode 1 Supported Parameters)

How would I go about translating this into readable values?
Nov 16 '05 #1
3 7591
I assume that you're interested in converting from hex values to integers.
In this case I recommend the following:

Convert.ToInt16( string, base );
Convert.ToInt32( string, base );
Convert.ToInt64( string, base );

Each of these returns the respective integer. <string> is a string
containing the data to convert. <base> is the number base and must have a
value of 2, 8, 10 or 16.

..ARN.
"aaa" wrote:
I have a third party DLL that downloads everything from a device to a
particular device into the following Hex format:

080 : 13 70 05 00 (Timestamp)
081 : 35 E1 91 F9 9F BF (Mode 1 Supported Parameters)

How would I go about translating this into readable values?

Nov 16 '05 #2
aaa
That doesn't work.
int i = Convert.ToInt32( "B3 0C 00 20", 2 );

"alanrn" <al****@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
I assume that you're interested in converting from hex values to integers.
In this case I recommend the following:

Convert.ToInt16( string, base );
Convert.ToInt32( string, base );
Convert.ToInt64( string, base );

Each of these returns the respective integer. <string> is a string
containing the data to convert. <base> is the number base and must have a
value of 2, 8, 10 or 16.

.ARN.
"aaa" wrote:
I have a third party DLL that downloads everything from a device to a
particular device into the following Hex format:

080 : 13 70 05 00 (Timestamp)
081 : 35 E1 91 F9 9F BF (Mode 1 Supported Parameters)

How would I go about translating this into readable values?

Nov 16 '05 #3
Try the following:

1) Take the spaces out of the string
2) use a base of 16 (for hexadecimal)

like this:

int i = Convert.ToInt32( "B30C0020", 16 );

When I tried this, I got a value of -1291059168 for i.

Using the following gave me a value of 3003908128:

Int64 i = Convert.ToInt64("B30C0020", 16 );

..ARN.

"aaa" wrote:
That doesn't work.
int i = Convert.ToInt32( "B3 0C 00 20", 2 );

"alanrn" <al****@discussions.microsoft.com> wrote in message
news:28**********************************@microsof t.com...
I assume that you're interested in converting from hex values to integers.
In this case I recommend the following:

Convert.ToInt16( string, base );
Convert.ToInt32( string, base );
Convert.ToInt64( string, base );

Each of these returns the respective integer. <string> is a string
containing the data to convert. <base> is the number base and must have a
value of 2, 8, 10 or 16.

.ARN.
"aaa" wrote:
I have a third party DLL that downloads everything from a device to a
particular device into the following Hex format:

080 : 13 70 05 00 (Timestamp)
081 : 35 E1 91 F9 9F BF (Mode 1 Supported Parameters)

How would I go about translating this into readable values?


Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Grant Edwards | last post by:
Perhaps I'm doing something wrong: the struct module docs say it's IEE 754, but I can't figure out how to get it to handle NaN values correctly (either packing or unpacking). >>> x =...
2
by: GuyInTn | last post by:
Hi all, I am trying to convert all the NULL values in a column to "Open". Any ideas?? TIA
2
by: Prabhudhas Peter | last post by:
Hello, Need an easy way to Display the property values of an object (dynamically) ie I need to show the values of an Object in a rich text box. Background : We have a form, with a rich...
5
by: Bob Homes | last post by:
In VB6, foreground and background colors of controls had to be assigned a single number. If you knew the RGB values for the color, you still had to convert them into the single number accepatable...
5
by: Angus | last post by:
Hello I have an unsigned char and I want to convert the individual array values into hex and copy to a std::string. The array does not always hold 14 values - but I do know the length of the...
2
by: =?Utf-8?B?YW1pcg==?= | last post by:
I am trying to convert a Dictionary into an array so that I can compare values and compare keys individually. I am looking for a solution like array i.e array of array.
1
by: Stephen Cattaneo | last post by:
Hi all, I am relatively new to socket programming. I am attempting to use raw sockets to spoof my IP address. From what I can tell I will have to build from the Ethernet layer on up. This is...
8
by: puzzlecracker | last post by:
Is it possible, in a clean way, to convert int values too bool int i=10; bool b=(bool)i; instead of doing b=(i>0);
0
by: Jeroen Mostert | last post by:
Bruce wrote: Sure, hence my "easy to say after the fact" remark. Once you've got it wrong, you're usually stuck with it. But if that's the only problem, isn't it trivial for you to just ignore...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.