C# winform写入和读取TXT文件

string str;
            str=this.textBox1.Text;
            StreamWriter sw = new StreamWriter(Application.StartupPath +"\\txtwriter.txt", false);
            sw.WriteLine(str);
            sw.Close();//写入

            string str;
            StreamReader sr = new StreamReader(Application.StartupPath +"\\txtreader.txt", false);
            str = sr.ReadLine().ToString();
            sr.Close();
            this.textBox1.Text = str;///读取

相关文章:

  • 2022-12-23
  • 2021-12-04
  • 2023-01-25
  • 2021-04-17
  • 2022-12-23
  • 2021-12-21
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-24
  • 2022-12-23
  • 2022-01-08
相关资源
相似解决方案