工程師的記錄簿
string txt_name = "test.txt"; FileStream fileStream = new FileStream(txt_name, FileMode.Create); fileStream.Close(); //要關! using (StreamWriter sw = new StreamWriter(txt_name)) { // write... foreach (var item in List) { sw.WriteLine(item); } }
沒有留言:
張貼留言