473,480 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

I need help converting a ByteArray to char

1 New Member
int nBytes = 256;
byte[] ByteArray = new byte[nBytes];
int nBytesRead = inputStream.Read(ByteArray, 0 , nBytes);

recorderID = "";


for (int i = 0; i <= 14; i++)
{
recorderID += char.ToString((char )ByteArray[14]);
}

in the recorderID I only need 14 bytes from the bytearray for the recorderID.
thanks
Sep 29 '06 #1
1 2184
Banfa
9,065 Recognized Expert Moderator Expert
[14]

should be

[i]
Sep 29 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
9898
by: James Dean | last post by:
i cannot convert my arraylist of bytes to a byte array what could be the problem. i tried the following but it did not work: byte bytearray = (byte)tempbitarray.ToArray(tempbitarray.GetType()); ...
4
5355
by: Prabhu | last post by:
Hi, We are having problem in converting a byte array to string, The byte array has char(174), char(175), char(240), char(242) and char(247) as delimiters for the message. when we use...
2
7301
by: Matt | last post by:
I just wanted to know if I am converting to/from streams the easiest and correct way. I am performing the following statements to convert byte arrays to and from streams during different...
5
2464
by: shivaprasad | last post by:
Hi all, I am a Beginner to c#. I Need to convert array of byte data type to string. How to do this.. ex: byte bytes = new byte; this bytes get filled up. Now I need to convert to string.
5
2223
by: Chris | last post by:
What is the best way to convert a bytearray into a string ? I thought I could do it using the code below, but is there anything faster/easier than this? Thanks! Chris int aLength =...
6
43136
by: LCD | last post by:
This a rather simple question for all you studs out there! Please help me with this. I have a string = "Please help me", and I want to convert this into it's hex equivalent. How do I do it, I...
27
1933
by: sam_cit | last post by:
Hi, I needed help in converting a character to the correspoding hexadecimal values, like the following example, ASCII value : ABC Hex Code Value : %41%42%43... whats the logic of conversion...
9
4015
by: Matt F | last post by:
How does one convert between byte and string? MF
22
9181
by: SQACSharp | last post by:
I'm trying to get the control name of an editbox in another window. The following code set the value "MyPassword" in the password EditBox but it fail to return the control name of the EditBox. ...
0
7046
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
6908
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7048
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,...
1
6741
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
4783
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
2997
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2986
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1300
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
563
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.