and so on/c#

[C#] 파일 쓰기

밀크빵 2013. 1. 18. 18:42

C#은 파일 쓰기 간단하다 


using System.IO;




string MyFile = @"data.txt";

            string buf = "Hi Hello 안녕";

StreamWriter FW = File.CreateText(MyFile);

            

FW.WriteLine(buf);

            

FW.Close();