Показать сообщение отдельно
Старый 10.06.2012, 22:35   #5
Gector
Легенда
 
Аватар для Gector
 
Регистрация: 14.10.2007
Сообщений: 3,878
Написано 2,012 полезных сообщений
(для 5,072 пользователей)
Ответ: WriteString записывает не только указанное значение

Сообщение от infuzo Посмотреть сообщение
Не помогло. Помогите мне убрать эти непонятные символы, а оставить только String. Использовать WriteLine мне нельзя, так как буду записывать несколько строчек.
Из хелпа:
Each string is stored in the file as a 4 byte (32bit) integer followed by the characters that form the string. The integer contains the number of characters in the string, i.e. its length. Note, that Carriage Return, Line Feed and Null characters are NOT use to indicate the end of the string. A file of strings cannot be read like a text file, since it contains string variables and not text. A null string, i.e. a string of zero length ("") is stored as 4 bytes, an integer count with a value = zero, followed by no Characters. Note strings are not limited to 255 characters as in some languages. Reading beyond the end of file does not result in an error, but each value read will be a zero length string.
Короче так и будет записываться с байтами-символами. Writeline тут как лучше раз. Просто просуммируй строку на запись.
__________________
Ибо как сказал Бгдн:
(Offline)
 
Ответить с цитированием
Сообщение было полезно следующим пользователям:
infuzo (10.06.2012)