FileStream fs;
StreamWriter sw;
//1.檔案路徑。必須先建立檔案。 2.開啟檔案 3.執行檔案的寫入
fs = new FileStream("C:\\test.txt", FileMode.Open, FileAccess.Write);
sw = new StreamWriter(fs);
sw.WriteLine("txttest");
sw.Flush();
sw.Close();
StreamWriter sw;
//1.檔案路徑。必須先建立檔案。 2.開啟檔案 3.執行檔案的寫入
fs = new FileStream("C:\\test.txt", FileMode.Open, FileAccess.Write);
sw = new StreamWriter(fs);
sw.WriteLine("txttest");
sw.Flush();
sw.Close();