close
using (StreamWriter sw = new StreamWriter("TestFile.TXT")) //小寫TXT
{
sw.Write("這是 ");
sw.WriteLine("一本書.");
sw.WriteLine("-------------------");
sw.Write("今天日期是: ");
sw.WriteLine(DateTime.Now);
}
Write 會接著後面列印
WriteLine 寫完自動換行
讀取文字檔 http://goodlucky.pixnet.net/blog/post/26147889
文章標籤
全站熱搜
留言列表