文本操作
public void BindData()
{
string path1 = Server.MapPath("../txt/comm.txt");
FileStream file1 = File.Open(path1, FileMode.Open, FileAccess.ReadWrite, FileShare.ReadWrite);
StreamReader read = new StreamReader(file1, Encoding.GetEncoding("GB2312"));
this.FCKeditor1.Value = read.ReadToEnd().ToString();
read.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
string path = Server.MapPath("../txt/comm.txt");
FileStream file = File.Open(path, FileMode.Truncate, FileAccess.ReadWrite, FileShare.ReadWrite);
StreamWriter stream = new StreamWriter(file, Encoding.GetEncoding("GB2312"));
string content = this.FCKeditor1.Value;
stream.Write(content);
stream.Flush();
stream.Close();
}