﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>Релиб / Программирование / .NET / C#  / Как правильно считать/записать файл в ANSI кодировке? / Latest Posts</title><generator>InstantForum.NET v4.1.4</generator><description>Релиб</description><link>http://www.relib.com/forums/</link><webMaster>robot@relib.com</webMaster><lastBuildDate>Thu, 08 Jan 2009 07:47:50 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Как правильно считать/записать файл в ANSI кодировке?</title><link>http://www.relib.com/forums/Topic908350-26-1.aspx</link><description>Вот здесь обсуждается как читать файлы с указанием кодировки.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.aspnetmania.com/Forums/ForumMessage/3608.html"&gt;http://www.aspnetmania.com/Forums/ForumMessage/3608.html&lt;/A&gt;</description><pubDate>Sun, 03 Dec 2006 23:53:35 GMT</pubDate><dc:creator>palva</dc:creator></item><item><title>RE: Как правильно считать/записать файл в ANSI кодировке?</title><link>http://www.relib.com/forums/Topic908350-26-1.aspx</link><description>Спасибо большое, попробую так и сделать.</description><pubDate>Sun, 03 Dec 2006 17:24:22 GMT</pubDate><dc:creator>tumanovalex</dc:creator></item><item><title>RE: Как правильно считать/записать файл в ANSI кодировке?</title><link>http://www.relib.com/forums/Topic908350-26-1.aspx</link><description>И, кстати, для расчета остатка от деления в С# есть специальный оператор - %</description><pubDate>Sat, 02 Dec 2006 13:30:44 GMT</pubDate><dc:creator>bazile</dc:creator></item><item><title>RE: Как правильно считать/записать файл в ANSI кодировке?</title><link>http://www.relib.com/forums/Topic908350-26-1.aspx</link><description>&lt;SPAN class=title&gt;&lt;A href="http://www.gotdotnet.ru/DotNet/FAQ/CommonForum/Interop/453.aspx"&gt;Как прочитать файл, содержащий русские символы?&lt;/A&gt;&lt;/SPAN&gt;</description><pubDate>Sat, 02 Dec 2006 10:35:23 GMT</pubDate><dc:creator>bazile</dc:creator></item><item><title>Как правильно считать/записать файл в ANSI кодировке?</title><link>http://www.relib.com/forums/Topic908350-26-1.aspx</link><description>Есть текстовой файл с ANSI кодировкой, английскими и русскими словами.&lt;BR&gt;Хочу в консольном приложении считать каждую 5-ю строку из этого файла, выввести эту строку на экран и в файл:&lt;BR&gt;StreamWriter outFile = File.CreateText(FileNameOut);&lt;BR&gt;StreamReader inFile  = File.OpenText(FileName);&lt;BR&gt;while((input = inFile.ReadLine())!= null) {&lt;BR&gt;    Math.DivRem(i, 5, out ost);&lt;BR&gt;    if(i==0 | ost==0 ) {&lt;BR&gt;     Console.WriteLine(res);&lt;BR&gt;     outFile.WriteLine(res);&lt;BR&gt;     }  &lt;BR&gt;    i++;&lt;BR&gt;   } // while&lt;BR&gt;К сожалению, на экране и в файле пропадают русские буквы. Как с этим бороться?&lt;BR&gt;</description><pubDate>Sat, 02 Dec 2006 00:18:58 GMT</pubDate><dc:creator>tumanovalex</dc:creator></item></channel></rss>