摘要:
// 读文件public TextWriter w;// 写文件public TextReader r;// 读文本文件private void button1_Click(object sender, System.EventArgs e){ if(openFileDialog1.ShowDialog() == DialogResult.OK) { textBox1.Text = openFileDialog1.FileName; r = new StreamReader(openFileDialog1.FileName, Sy... 阅读全文
posted @ 2009-09-15 10:59
清山博客
阅读(170)
评论(0)
推荐(0)
摘要:
1.写入二进制文件:①用到的命名空间:using System.IO;using System.Text;②写进二进制文件:public Stream s; public BinaryWriter w;s = File.Create("test.bin");w = new BinaryWriter(s);//基于所提供的流,用 UTF-8 作为字符串编码来初始化 BinaryWriter 类的新实例。 string str = "这是一行文字。/n"; w.Write(str); float a = 3.1415F; w.Write(a); ulong 阅读全文
posted @ 2009-09-15 10:58
清山博客
阅读(282)
评论(0)
推荐(0)