I have a textblock and there’re some text in it. When I convert the string in the textblock to stream, the stream.size always longer than textblock.text.length, why? Always have 4 characters longer.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Here’s my test, and the results:
In XAML:
In C#:
So my answer is: either you have encoding issues, or you made the stream wrong. And if I was to take a guess, you messed with the last 2 arguments of Stream.Write .