473,385 Members | 1,766 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.

Conversion of hexadecimal value to valid text

Hi,

I have a Byte array that holds hexadecimal values (ASCII e.g. byte value is
hex 54 for the letter T).
Dim bytes() As Byte = New Byte(size) {}
..... get the bytes array
For index As Int32 = 0 To bytes.Length - 1

contents &= bytes(index).ToString("?????????????")

Next

Which method can I use to create a .Net string from the values of the byte
array?

Thanks in advance.

--
Best regards

Henry
Nov 21 '05 #1
2 1208
Try this

Dim b() As Byte
System.Text.ASCIIEncoding.ASCII.GetString(b)
"Henry" <he********@nospam.nospam> wrote in message
news:CF**********************************@microsof t.com...
Hi,

I have a Byte array that holds hexadecimal values (ASCII e.g. byte value
is
hex 54 for the letter T).
Dim bytes() As Byte = New Byte(size) {}
.... get the bytes array
For index As Int32 = 0 To bytes.Length - 1

contents &= bytes(index).ToString("?????????????")

Next

Which method can I use to create a .Net string from the values of the byte
array?

Thanks in advance.

--
Best regards

Henry

Nov 21 '05 #2
Hi

Did you have any concern with Amdrit's suggestion?
If so, please feel free to post here.

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #3

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

Similar topics

10
by: pavithra.eswaran | last post by:
Hi, I would like to convert a single precision hexadecimal number to floating point. The following program seems to work fine.. But I do not want to use scanf. I already have a 32 bit hexadecimal...
2
by: akash deep batra | last post by:
hi i want to convert a 96 bit binary number into a hexadecimal number. e.g binary number= 001100010001010000100101011110111111010101110100010110000101011000101010000000000000000000000000 how...
4
by: rz0 | last post by:
Hi all, This is a question about both C89 and C99 and is based on my partial reading of the standard drafts (one from before C89 but mainly N1124). If appropriate, please give a...
11
by: santosh | last post by:
Hello all, Conversion macros along the name of INT8_C, INT16_C etc, are defined in stdint.h to convert their argument into suitable representations for their corresponding types, i.e. int8_t,...
8
by: Eric Lilja | last post by:
Hello, I have IPv4-numbers in the following format: "\\x0A\\x11\\x8C\\x01" Now I need each byte as an int. I wrote the following test program: #include <stdio.h> #include <stdlib.h> static...
14
by: dharmdeep | last post by:
Hi friends, I need a sample code in C which will convert a Hexadecimal number into decimal number. I had written a code for that but it was too long, I need a small code, so request u all to...
7
by: elliotng.ee | last post by:
I have a text file that contains a header 32-bit binary. For example, the text file could be: %%This is the input text %%test.txt Date: Tue Dec 26 14:03:35 2006...
11
by: sweeet_addiction16 | last post by:
hello im programming in c.i have to write about 100 hexadecimal values in to a file. how do i do it?pls help me
6
by: i_robot73 | last post by:
I have a file, containing hex values for dates (MMDDYYYY)<status code><??such as: ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.