using System;
using System.Collections.Generic;
using
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
StreamReader sr = new StreamReader(@"C:\Documents and Settings\Administrator\桌面\文件\十点整.txt", Encoding.GetEncoding("GB2312"));
while (sr.Peek() != -1)
{
richTextBox1.Text += sr.ReadLine();
richTextBox1.Text += "\n";
}
sr.Close();
}
}
}
//成功了,谢谢各位了!无论是中文还是英文,都成功!但不知道除了GB2312,还有其他的吗?还有是不是写入文件的时候也要指定编码吗?