读取写入TXT文件

时间:2014-12-20 11:06:56
【文件属性】:
文件名称:读取写入TXT文件
文件大小:36KB
文件格式:RAR
更新时间:2014-12-20 11:06:56
读取写入TXT文件 读取写入TXT文件 if (this.textBox1.Text == "") { MessageBox.Show(this, "文件名不能为空!", "提示对话框", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { StreamWriter sw = new StreamWriter(Application.StartupPath + "\\" + textBox1.Text + ".txt"); sw.Write(textBox2.Text); sw.Flush(); sw.Close(); MessageBox.Show(this, "文件写入成功!", "提示对话框", MessageBoxButtons.OK, MessageBoxIcon.Information); }
【文件预览】:
读取写入TXT文件
----bin()
--------Debug()
----Form1.Designer.cs(5KB)
----读取写入TXT文件.csproj(4KB)
----Program.cs(518B)
----obj()
--------Debug()
----Form1.cs(3KB)
----Form1.resx(6KB)
----Properties()
--------Resources.resx(5KB)
--------Settings.settings(249B)
--------AssemblyInfo.cs(1KB)
--------Settings.Designer.cs(1KB)
--------Resources.Designer.cs(3KB)

网友评论