![]() |
#2
awl8052013-03-15 20:47
|
第一次测试时只有写了储存的编码,也成功储存
於是又接着写了读取的编码,也有成功读取
但是储存的功能却失效了,当我把读取编码拿掉以後就又恢复功能
实在不知道问题出在哪里,希望有人可以帮帮我
编码跟网页介面都在下面了
谢谢大家~

只有本站会员才能查看附件,请 登录

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using namespace MyMasterPage
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string filePath = Server.MapPath("~/content.txt");
TextReader reader = File.OpenText(filePath);
TextBoxContent.Text = reader.ReadToEnd();
reader.Close();
}
protected void Button1_Click(object sender, EventArgs e)
{
string filePath = Server.MapPath("~/content.txt");
TextWriter writer = new StreamWriter(filePath);
writer.Write(TextBoxContent.Text);
writer.Close();
}
}
}