TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
andrei hooba
NA
63
24k
Reading response data in hexa
Mar 4 2012 7:36 AM
after i send this packet
byte[] data2 = { 0x00, 0x0E, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x4A, 0x43, 0x50, 0x55, 0x7C, 0x47, 0x45, 0x54 };
stream.Write(data2, 0, data2.Length);
System.Threading.Thread.Sleep(1000);
i'm trying to get some informations from server response.
data2 = new Byte[1024];
bytes = stream.Read(data2, 0, data2.Length);
string responseData = System.Text.Encoding.ASCII.GetString(data2, 0, bytes);
string response = find_str_from_to2(responseData, "galexu", "0|A|CC|");
string intohex = convertAsciiTextToHex(response);
static String convertAsciiTextToHex(String i_asciiText)
{
StringBuilder sBuffer = new StringBuilder();
for (int i = 0; i < i_asciiText.Length; i++)
{
sBuffer.Append(Convert.ToInt32(i_asciiText[i]).ToString("x"));
}
return sBuffer.ToString().ToUpper();
}
the problem is that if the responseData is encoded as: ASCII, UTF-8... etc it doesn't get the real information from the server response.
any ideas?
thank you.
Reply
Answers (
7
)
Can anyone help with arrays
libopenMetaveres