[汇总]如何有效的使用C#读取文件 及如何解决中文乱码问题

            StreamReader din = new StreamReader(@"C:\1.txt", System.Text.Encoding.GetEncoding("gb2312"));
            string html = "";
            while (din.Peek() > -1)
            {
                html = html + din.ReadToEnd();
            }
            din.Close();
posted @ 2008-04-04 23:00  vs.net  阅读(114)  评论(0)    收藏  举报