【C#学习笔记】写文件

using System;
using System.IO;

namespace ConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            FileStream file = new FileStream("log.txt", FileMode.OpenOrCreate);
            StreamWriter sw = new StreamWriter(file);
            sw.Write("xiaoming");
            sw.Close();

        }      
    }
}

 

posted @ 2017-08-27 15:07  Dsp Tian  阅读(345)  评论(0编辑  收藏  举报