C# winform写入和读取TXT文件

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;///读取

上一篇:javascript-来自sprite和视网膜证明的自定义google maps标记


下一篇:winform 写入和读取TXT文件