电子灵魂

golang,go,C#,JAVA,PYTHON,PHP

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理
private void button1_Click(object sender, EventArgs e)
        {
            FileStream fs = new FileStream("123.txt", FileMode.Append);
            StreamWriter ws = new StreamWriter(fs);
            ws.WriteLine(this.txtbox.Text = DateTime.Now.ToString()+"  " + "写入成功");
            ws.Close();
            fs.Close();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            FileStream fs = new FileStream("123.txt", FileMode.Open);           
            StreamReader ws = new StreamReader(fs);
            this.txtbox.Text = ws.ReadToEnd();
            ws.Close();
            fs.Close();
        }
posted on 2015-04-29 09:43  conncent  阅读(736)  评论(0编辑  收藏  举报