0

Hello again,

How can I count the message size from:

msg.Body = tbText.Text;

?
I need to get KBs.

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by Lusiphur
0

Well, if we assume each character is a byte (generally) then you can use tbText.Text.Length to get the total number of characters (bytes) contained in the text segment you're working with and convert from there.

Hope that helps :) Please remember to mark solved once your issue is resolved.

0

Oh, if it's so, than it's just a piece of a cake... thank you

1

Please remember that the character count and byte count are not the same.
The byte count will depend upon the text encoding (ASCII, UTF8 etc.).

Votes + Comments
Darn you nice catch :P
0

if we assume each character is a byte (generally)

Which is why I said "if we assume" each character is a byte :) Correctly noted that different encoding produces different sizes and as such one should determine the size of each character unit prior to relying on my example.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.