现在的位置: 首页 > 综合 > 正文

一个简单的写文件

2012年12月29日 ⁄ 综合 ⁄ 共 188字 ⁄ 字号 评论关闭

     读写文件一开始看似困难,其实内容并不多。

例如:

            string path = @"D:\01.txt";

            FileStream fs = new FileStream(path,FileMode.Create);

            StreamWriter sw = new StreamWriter(fs);

            sw.WriteLine("aabbb");

            sw.WriteLine("bb");

            sw.Close();

 

抱歉!评论已关闭.