Hello everyone,
I am using the following code to read a string. The content of message is ends with a lot of \0 characters. Why and how to remove them?
(context is an instance of HttpListenerContext, and my code is read Http request from begin to end)
[Code]
using (StreamReader requestStream = new StreamReader(context.Request.InputStream))
{
message = requestStream.ReadToEnd();
}
[/Code]
thanks in advance,
George

Jan MontanoRank #1,295 · 1.3K reputationPosted Jun 24, 2008, 8:05 PM EDT
George GeorgeRank #1,736 · 870 reputationPosted Jun 25, 2008, 12:36 AM EDT
Thanks Jan!
Your solution works! Do you know why there is pending \0 in input stream of Http Request? Could client send \0 through Http communication? :-)
regards,
George
Jan MontanoRank #1,295 · 1.3K reputationPosted Jun 25, 2008, 1:59 AM EDT
George GeorgeRank #1,736 · 870 reputationPosted Jun 25, 2008, 2:13 AM EDT
Thanks all the same, Jan!
regards,
George