【C#學習筆記】寫檔案

Dsp Tian發表於2017-08-27
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();

        }      
    }
}

 

相關文章