Click here to Skip to main content
15,917,321 members

Comments by Akhand Jyoti (Top 6 by date)

Akhand Jyoti 12-Jan-18 5:15am View    
Thank u so much.It works.
Akhand Jyoti 12-Jan-18 4:06am View    
Thank u so much for your advice.
Akhand Jyoti 9-Jan-18 7:19am View    
No,its working.
I m getting result as a Byte array,but not in the expected form.
I want result like:
bytes={ 0x01, 0x9F, 0x31, 0x4A }
Akhand Jyoti 8-Jan-18 4:33am View    
Thank u so much .This worked for me.I just got the data as Byte from the port and took into a string it worked.I got the expected output.thank u so much.
Here is the code.
int bytes = serialPort2.BytesToRead;
byte[] array = new byte[bytes];
int i = 0;
while (serialPort2.BytesToRead > 0)
{
array[i] = Convert.ToByte(serialPort2.ReadByte());
i++;
}

string s = BitConverter.ToString(array);
Akhand Jyoti 3-Jan-18 6:10am View    
hey i have tried this code work for that particular unicode srting.
I have a unicode string like.
string str="~\0\u0016?\0\u0013?\0AT??\\?\u0001#yfgyhvkh#?";
after doing the above operation i am not getting the converted string .please help me .Thank u so much in advance.
I should receive the data like:
7E 00 15 90 00 13 A2 00 41 54 EC 8E 5C 9F 01 23 31 32 23 31 32 23 52 23 0B