c# 创建文件

来源:互联网 发布:淘宝的地址在哪里修改 编辑:程序博客网 时间:2024/05/14 12:06
     using System.IO;

 

            string fileName;

            fileName = "文件名";

 

            //建立StreamWrite

            StreamWriter rw = File.CreateText(路径);

 

            //使用WriteLine写入内容

            rw.WriteLine();         


            //将缓冲区的内容写入文件

            rw.Flush();

            //关闭rw对象

            rw.Close();

0 0